Looking at System.Collections.Generic.Dictionary<TKey, TValue>
, it clearly implements ICollection<KeyValuePair<TKey, TValue>>
, but doesn't have the required "void Add(KeyValuePair<TKey, TValue> item)
" function.
This can also be seen when trying to initialize a Dictionary
like this:
private const Dictionary<string, int> PropertyIDs = new Dictionary<string, int>()
{
new KeyValuePair<string,int>("muh", 2)
};
which fails with
No overload for method 'Add' takes '1' arguments
Why is that so?