IDictionary<TKey, TValue>continues from the interface ICollection<KeyValuePair<TKey, TValue>>, so it has a method Add(KeyValuePair<TKey, TValue> item):
IDictionary<string, object> dic = new Dictionary<string, object>();
dic.Add(new KeyValuePair<string, object>("number", 42));
However, although it Dictionary<TKey, Tvalue>implements IDictionary<TKey, TValue>, it does not have this overload function:
Dictionary<string, object> dic = new Dictionary<string, object>();
dic.Add(new KeyValuePair<string, object>("number", 42));
How can it be?
source
share