本文整理汇总了C#中IReadOnlyDictionary.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# IReadOnlyDictionary.ToString方法的具体用法?C# IReadOnlyDictionary.ToString怎么用?C# IReadOnlyDictionary.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IReadOnlyDictionary
的用法示例。
在下文中一共展示了IReadOnlyDictionary.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Build
public string Build(IReadOnlyDictionary<IParameterType, IParameter> parameters)
{
string parametersStr = parameters.ToString();
string url = [email protected]"{Domain}/epz/order/extendedsearch/results.html?{parametersStr}searchString=&openMode=USE_DEFAULT_PARAMS&sortDirection=false&showLotsInfoHidden=false&orderNumber=&placingWaysList=&placingWaysList223=¤cyId=1&orderName=&participantName=&updateDateFrom=&updateDateTo=&customerTitle=&customerCode=&customerFz94id=&customerFz223id=&customerInn=&agencyTitle=&agencyCode=&agencyFz94id=&agencyFz223id=&agencyInn=&districts=®ions=&af=on&ca=on&deliveryAddress=&sortBy=RELEVANCE";
return url;
}
示例2: InsertRow
private async Task<IRow> InsertRow(string key, IReadOnlyDictionary<string, string> columns)
{
logger.Info("inserting row to file: " + columns.ToString());
if (string.IsNullOrWhiteSpace(key))
{
throw new ArgumentNullException(CommaDelimitedFileAdapter.ArgumentNameRow);
}
if (null == columns)
{
throw new ArgumentNullException(CommaDelimitedFileAdapter.ArgumentNameColumns);
}
IDictionary<string, string> valuesByNormalizedNames =
columns
.ToDictionary(
(KeyValuePair<string, string> item) =>
new Value(item.Key).ToString().ToUpperInvariant(),
(KeyValuePair<string, string> item) =>
item.Value);
IList<string> values = new List<string>(this.headers.Count);
string keyNormalized = new Value(key).ToString();
values.Add(keyNormalized);
IEnumerable<string> normalizedHeaders = this.headersNormalized.Skip(1);
foreach (string normalizedHeader in normalizedHeaders)
{
string value = null;
if (!valuesByNormalizedNames.TryGetValue(normalizedHeader, out value))
{
values.Add(string.Empty);
continue;
}
string normalizedValue = new Value(value).ToString();
values.Add(normalizedValue);
}
string row =
string.Join(CommaDelimitedFileAdapter.Comma, values);
AsyncSemaphore.Releaser? releaser = null;
try
{
releaser = await this.semaphore.EnterAsync();
StreamWriter writer = null;
try
{
writer = File.AppendText(this.FilePath);
logger.Info("inserting row: " + row);
await writer.WriteLineAsync(row);
}
finally
{
if (writer != null)
{
writer.Close();
writer = null;
}
}
}
finally
{
if (releaser.HasValue)
{
releaser.Value.Dispose();
releaser = null;
}
}
IRow result = new Row(keyNormalized, columns);
return result;
}