ImmutableDictionary<TKey,TValue>.Builder.Add Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Add(KeyValuePair<TKey,TValue>) |
Adds the specified item to the immutable dictionary. |
Add(TKey, TValue) |
Adds an element that has the specified key and value to the immutable dictionary. |
Adds the specified item to the immutable dictionary.
public:
virtual void Add(System::Collections::Generic::KeyValuePair<TKey, TValue> item);
public void Add(System.Collections.Generic.KeyValuePair<TKey,TValue> item);
abstract member Add : System.Collections.Generic.KeyValuePair<'Key, 'Value> -> unit
override this.Add : System.Collections.Generic.KeyValuePair<'Key, 'Value> -> unit
Public Sub Add (item As KeyValuePair(Of TKey, TValue))
Parameters
The object to add to the dictionary.
Implements
Exceptions
The dictionary is read-only.
Applies to
.NET 10 и друге верзије
Производ | Верзије |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Standard | 2.0 (package-provided) |
UWP | 10.0 |
Adds an element that has the specified key and value to the immutable dictionary.
public:
virtual void Add(TKey key, TValue value);
public void Add(TKey key, TValue value);
abstract member Add : 'Key * 'Value -> unit
override this.Add : 'Key * 'Value -> unit
Public Sub Add (key As TKey, value As TValue)
Parameters
- key
- TKey
The key of the element to add.
- value
- TValue
The value of the element to add.
Implements
Exceptions
key
is null.
An element with the same key already exists in the dictionary.
The dictionary is read-only.
Applies to
.NET 10 и друге верзије
Производ | Верзије |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Standard | 2.0 (package-provided) |
UWP | 10.0 |
.NET повратне информације
.NET је пројекат отвореног кода. Изаберите везу да бисте обезбедили повратне информације: