ImmutableDictionary<TKey,TValue>.IDictionary<TKey,TValue>.Add Method

Definition

Adds an element with the provided key and value to the immutable dictionary.

C#
void IDictionary<TKey,TValue>.Add(TKey key, TValue value);

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 IDictionary<TKey,TValue>.

Applies to

Product Versions
.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
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)
UWP 10.0