Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ImmutableDictionary<TKey, TValue>::IDictionary<TKey, TValue>::Add Method (TKey, TValue)

 

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

Namespace:   System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

private:
virtual void Add(
	TKey key,
	TValue value
) sealed = IDictionary<TKey, TValue>::Add

Parameters

key
Type: TKey

The object to use as the key of the element to add.

value
Type: TValue

The object to use as the value of the element to add.

Exception Condition
ArgumentNullException

key is null.

ArgumentException

An element with the same key already exists in the dictionary.

NotSupportedException

The dictionary is read-only.

This member is an explicit interface member implementation. It can be used only when the ImmutableDictionary<TKey, TValue> instance is cast to an IDictionary<TKey, TValue> interface.

Return to top
Show:
© 2017 Microsoft