My scenario,
how to convert List<KeyValuePair<string, string>> into IDictionary<string, string>?
My scenario,
how to convert List<KeyValuePair<string, string>> into IDictionary<string, string>?
You can also use the constructor overload of Dictionary<TKey,TValue> that takes an IEnumerable<KeyValuePair<TKey,TValue>> as parameter.
var list = new List<KeyValuePair<int, string>>();
var dictionary = new Dictionary<int, string>(list);