Add implicit operators to WireMockList (#823)

* Add implicit operators to WireMockList

* .
This commit is contained in:
Stef Heyenrath
2022-10-01 10:50:18 +02:00
committed by GitHub
parent f7b04f3234
commit 430c01a461
3 changed files with 68 additions and 36 deletions

View File

@@ -251,8 +251,15 @@ internal class MappingConverter
var newDictionary = new Dictionary<string, object>();
foreach (var entry in dictionary)
{
object value = entry.Value.Count == 1 ? entry.Value.ToString() : entry.Value;
newDictionary.Add(entry.Key, value);
// ReSharper disable once ConvertIfStatementToConditionalTernaryExpression
if (entry.Value.Count == 1)
{
newDictionary.Add(entry.Key, entry.Value.ToString());
}
else
{
newDictionary.Add(entry.Key, entry.Value);
}
}
return newDictionary;