Why does Dictionary.ContainsKey throw ArgumentNullException?

Viewed 14902

The documentation states that bool Dictionary<TKey, TValue>.ContainsKey(TKey key) throws an exception in case a null key is passed. Could anyone give a reason for that? Wouldn't it be more practical if it just returned false?

2 Answers
Related