Dictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.Add Método

Definição

Adiciona o valor especificado ao ICollection<T> com a chave especificada.

 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

Parâmetros

keyValuePair
KeyValuePair<TKey,TValue>

A estrutura KeyValuePair<TKey,TValue> que representa a chave e o valor a serem adicionados ao Dictionary<TKey,TValue>.

Implementações

Exceções

A chave do keyValuePair é null.

Já existe um elemento com a mesma chave no Dictionary<TKey,TValue>.

Aplica-se a