I found the default implemtation of ToString in the dictionary is not what I want. I would like to have {key=value, ***}
.
Any handy way to get it?
Try this extension method:
public static string ToDebugString<TKey, TValue> (this IDictionary<TKey, TValue> dictionary)
{
return "{" + string.Join(",", dictionary.Select(kv => kv.Key + "=" + kv.Value).ToArray()) + "}";
}