Dictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Add Metodo

Definizione

Aggiunge il valore specificato all'interfaccia ICollection<T> con la chiave specificata.

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

Parametri

keyValuePair
KeyValuePair<TKey,TValue>

Struttura KeyValuePair<TKey,TValue> che rappresenta la chiave e il valore da aggiungere alla raccolta Dictionary<TKey,TValue>.

Implementazioni

Eccezioni

La chiave di keyValuePair è null.

In Dictionary<TKey,TValue> è già presente un elemento con la stessa chiave.

Si applica a