Method Add
Add(TKey, TValue)
Adds a new key-value pair.
Declaration
public void Add(TKey key, TValue item)
Parameters
Type | Name | Description |
---|---|---|
TKey | key | The key to add. |
TValue | item | The value to add. |
Remarks
If the key is already present, this method throws without modifying the hash map.
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if the key was already present. |