Class ImmutableEquatableDictionary<TKey, TValue>
Defines an immutable dictionary that defines structural equality semantics.
public sealed class ImmutableEquatableDictionary<TKey, TValue> : IEquatable<ImmutableEquatableDictionary<TKey, TValue>>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable where TKey : IEquatable<TKey> where TValue : IEquatable<TValue>
Type Parameters
TKeyThe key type of the dictionary.
TValueThe value type of the dictionary.
- Inheritance
-
ImmutableEquatableDictionary<TKey, TValue>
- Implements
-
IEquatable<ImmutableEquatableDictionary<TKey, TValue>>IDictionary<TKey, TValue>ICollection<KeyValuePair<TKey, TValue>>IReadOnlyDictionary<TKey, TValue>IReadOnlyCollection<KeyValuePair<TKey, TValue>>IEnumerable<KeyValuePair<TKey, TValue>>
- Inherited Members
- Extension Methods
Properties
Count
Gets the number of key/value pairs in the dictionary.
public int Count { get; }
Property Value
Empty
An empty ImmutableEquatableDictionary<TKey, TValue> instance.
public static ImmutableEquatableDictionary<TKey, TValue> Empty { get; }
Property Value
- ImmutableEquatableDictionary<TKey, TValue>
this[TKey]
Gets the value associated with the specified key.
public TValue this[TKey key] { get; }
Parameters
keyTKey
Property Value
- TValue
Keys
Gets a collection containing the keys in the dictionary.
public Dictionary<TKey, TValue>.KeyCollection Keys { get; }
Property Value
- Dictionary<TKey, TValue>.KeyCollection
Values
Gets a collection containing the values in the dictionary.
public Dictionary<TKey, TValue>.ValueCollection Values { get; }
Property Value
- Dictionary<TKey, TValue>.ValueCollection
Methods
ContainsKey(TKey)
Determines whether the dictionary contains the specified key.
public bool ContainsKey(TKey key)
Parameters
keyTKey
Returns
Equals(ImmutableEquatableDictionary<TKey, TValue>)
public bool Equals(ImmutableEquatableDictionary<TKey, TValue> other)
Parameters
otherImmutableEquatableDictionary<TKey, TValue>
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetEnumerator()
Gets an enumerator that iterates through the dictionary.
public Dictionary<TKey, TValue>.Enumerator GetEnumerator()
Returns
- Dictionary<TKey, TValue>.Enumerator
GetHashCode()
public override int GetHashCode()
Returns
TryGetValue(TKey, out TValue)
Try to get the value associated with the specified key.
public bool TryGetValue(TKey key, out TValue value)
Parameters
keyTKeyvalueTValue