Why can I not add null as a value when using ConcurrentDictionary?
<p>Consider the following code:</p>

<pre><code>// holds the actual values
        private volatile ConcurrentDictionary&lt;string, Object&gt; values;

        public object this[string key] {
            get {     
                // exception is thrown on this line          
                return values.GetOrAdd(key, null);                
            }
            set {
                values.AddOrUpdate(key, value, (k, v) =&gt; value);                
            }
        }
</code></pre>

<p>What I want to do is simply create the entry in the dictionary if it does not exist yet; it should have no value though until something explicitly sets it. I get this exception though:</p>

<pre><code>An unhandled exception of type 'System.ArgumentNullException' occurred in mscorlib.dll

Additional information: Value cannot be null.
</code></pre>

<p>The documentation states that key cannot be null, which makes sense. why am I getting this exception for a value though? Am I not understanding this method? </p>