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