Post­Sharp Documentation / API Reference / Post­Sharp.​Patterns.​Collections Namespace / Advisable­Dictionary(TKey, TValue) Class / Advisable­Dictionary(TKey, TValue) Methods / Advisable­Dictionary(TKey, TValue).​Add Method

AdvisableDictionary<TKey, TValue>.Add Method

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

Namespace:  PostSharp.Patterns.Collections
Assembly:  PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 5.0.43.0 (5.0.43.0)
Syntax
C#
public void Add(
	TKey key,
	TValue value
)

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.

Implements

IDictionary<TKey, TValue>.Add(TKey, TValue)
Exceptions
ExceptionCondition
ArgumentNullExceptionkey is null.
ArgumentExceptionAn element with the same key already exists in the IDictionary<TKey, TValue>.
NotSupportedExceptionThe IDictionary<TKey, TValue> is read-only.
See Also