Class ComparableDictionary<TKey, TValue>
Represents a comparable collection of key/value pairs that extends the standard dictionary functionality.
public class ComparableDictionary<TKey, TValue> : Dictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, IDeserializationCallback, ISerializable where TKey : notnull where TValue : notnull
Type Parameters
TKeyThe type of the keys in the dictionary, constrained to non-nullable types.
TValueThe type of the values in the dictionary, constrained to non-nullable types.
- Inheritance
-
Dictionary<TKey, TValue>ComparableDictionary<TKey, TValue>
- Implements
-
IDictionary<TKey, TValue>ICollection<KeyValuePair<TKey, TValue>>IReadOnlyDictionary<TKey, TValue>IReadOnlyCollection<KeyValuePair<TKey, TValue>>IEnumerable<KeyValuePair<TKey, TValue>>
- Inherited Members
- Extension Methods
Remarks
Inherits from Dictionary<TKey, TValue> and enforces that both keys and values are non-nullable.
Methods
GetHashCode()
Generates a hash code for the collection by concatenating the string representations of all key-value pairs, separated by underscores and double percent signs, and returning the hash code of the resulting string.
public override int GetHashCode()
Returns
- int
An integer hash code derived from the concatenated key-value pairs of the collection.