PostSharpAPI ReferencePost­Sharp.​Patterns.​CollectionsAdvisable­Dictionary<TKey, TValue>Add
Open sandboxFocus

Method Add

Add(TKey, TValue)

Adds an element with the provided key and value to the IDictionary<TKey,TValue>.

Declaration
public void Add(TKey key, TValue value)
Parameters
Type Name Description
TKey key

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

TValue value

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

Exceptions
Type Condition
ArgumentNullException

key is null.

ArgumentException

An element with the same key already exists in the IDictionary<TKey,TValue>.

NotSupportedException

The IDictionary<TKey,TValue> is read-only.