Property this
this[TKey]
Gets the keyed value collection associated with the specified key. If the key is not found then a new value collection is returned which can be used to add values to the key or to monitor when items are added to the key.
Declaration
IKeyedCollection<TKey, TValue> this[TKey key] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| TKey | key |
Property Value
| Type | Description |
|---|---|
| IKeyedCollection<TKey, TValue> |
Remarks
Empty value collections, such as new collections returned using this indexer when the key is not found, are not part of the dictionary until items are added to them. When a value collection becomes empty again, it is removed from the dictionary. Value collections stay synchronized with their dictionary to always reflect the values associated with their key inside the dictionary.