ImmutableDictionary<TKey,TValue>.Add(TKey, TValue) Método
Definición
Agrega un elemento con la clave y el valor especificados en el diccionario inmutable.Adds an element with the specified key and value to the immutable dictionary.
public:
System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ Add(TKey key, TValue value);
public System.Collections.Immutable.ImmutableDictionary<TKey,TValue> Add (TKey key, TValue value);
member this.Add : 'Key * 'Value -> System.Collections.Immutable.ImmutableDictionary<'Key, 'Value>
Public Function Add (key As TKey, value As TValue) As ImmutableDictionary(Of TKey, TValue)
Parámetros
- key
- TKey
Clave del elemento que se va a agregar.The key of the element to add.
- value
- TValue
Valor del elemento que se va a agregar.The value of the element to add.
Devoluciones
Nuevo diccionario inmutable que contiene el par de clave-valor adicional.A new immutable dictionary that contains the additional key/value pair.
Excepciones
La clave especificada ya existe en el diccionario, pero tiene un valor diferente.The given key already exists in the dictionary but has a different value.
Comentarios
Si el par clave-valor especificado ya existe en el diccionario, se devuelve la instancia existente del diccionario.If the given key/value pair already exists in the dictionary, the existing instance of the dictionary is returned.