IDictionary<TKey,TValue>.Add Method

Overloads

Add(TKey, TValue)

Adds the specified key and value to the dictionary.

Add(TKey, TValue)

Adds the specified key and value to the dictionary.

Delphi
procedure Add(const Key: TKey; const Value: TValue); overload;

Parameters

Key
TKey

The key to add.

Value
TValue

The value to add.

Exceptions

Key already exists in the dictionary.

Remarks

The key must not already exist in the dictionary. To add or replace a value, use the Items property.