IImmutableDictionary<TKey, TValue> Interface
Represents an immutable collection of key/value pairs.
NuGet package: System.Collections.Immutable (about immutable collections and how to install)
Assembly: System.Collections.Immutable (in System.Collections.Immutable.dll)
generic<typename TKey, typename TValue> public interface class IImmutableDictionary : IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
Type Parameters
- TKey
The type of keys in the dictionary.
- TValue
The type of values in the dictionary.
| Name | Description | |
|---|---|---|
![]() | Count | (Inherited from IReadOnlyCollection<T>.) |
![]() | Item[TKey] | (Inherited from IReadOnlyDictionary<TKey, TValue>.) |
![]() | Keys | (Inherited from IReadOnlyDictionary<TKey, TValue>.) |
![]() | Values | (Inherited from IReadOnlyDictionary<TKey, TValue>.) |
| Name | Description | |
|---|---|---|
![]() | Add(TKey, TValue) | Adds an element with the specified key and value to the dictionary. |
![]() | AddRange(IEnumerable<KeyValuePair<TKey, TValue>>^) | Adds the specified key/value pairs to the dictionary. |
![]() | Clear() | Retrieves an empty dictionary that has the same ordering and key/value comparison rules as this dictionary instance. |
![]() | Contains(KeyValuePair<TKey, TValue>) | Determines whether the immutable dictionary contains the specified key/value pair. |
![]() | ContainsKey(TKey) | (Inherited from IReadOnlyDictionary<TKey, TValue>.) |
![]() | GetEnumerator() | (Inherited from IEnumerable<T>.) |
![]() | Remove(TKey) | Removes the element with the specified key from the immutable dictionary. |
![]() | RemoveRange(IEnumerable<TKey>^) | Removes the elements with the specified keys from the immutable dictionary. |
![]() | SetItem(TKey, TValue) | Sets the specified key and value in the immutable dictionary, possibly overwriting an existing value for the key. |
![]() | SetItems(IEnumerable<KeyValuePair<TKey, TValue>>^) | Sets the specified key/value pairs in the immutable dictionary, possibly overwriting existing values for the keys. |
![]() | TryGetKey(TKey, TKey%) | Determines whether this dictionary contains a specified key. |
![]() | TryGetValue(TKey, TValue%) | (Inherited from IReadOnlyDictionary<TKey, TValue>.) |
A IImmutableDictionary<TKey, TValue> requires an equality comparer implementation to determine if two keys are equal.

