ConcurrentDictionary<TKey,TValue>.IDictionary<TKey,TValue>.Add(TKey, TValue) Method

Definition

Adds the specified key and value to the IDictionary<TKey,TValue>.

 virtual void System.Collections.Generic.IDictionary<TKey,TValue>.Add(TKey key, TValue value) = System::Collections::Generic::IDictionary<TKey, TValue>::Add;
void IDictionary<TKey,TValue>.Add (TKey key, TValue value);
abstract member System.Collections.Generic.IDictionary<TKey,TValue>.Add : 'Key * 'Value -> unit
override this.System.Collections.Generic.IDictionary<TKey,TValue>.Add : 'Key * 'Value -> unit
Sub Add (key As TKey, value As TValue) Implements IDictionary(Of TKey, TValue).Add

Parameters

key
TKey

The object to use as the key of the element to add.

value
TValue

The object to use as the value of the element to add.

Implements

Exceptions

key is null.

An element with the same key already exists in the ConcurrentDictionary<TKey,TValue>.

The dictionary contains too many elements.

Applies to

See also