# Class ComparableDictionary<TKey, TValue>

Namespace
  adas_core.Domain.Utils

Assembly
  adas-core.Domain.dll

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

`TKey`

  The type of the keys in the dictionary, constrained to non-nullable types.

`TValue`

  The type of the values in the dictionary, constrained to non-nullable types.

Inheritance
  object
  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>>
  IDictionary
  ICollection
  IEnumerable
  IDeserializationCallback
  ISerializable

Inherited Members
  Dictionary<TKey, TValue>.Add(TKey, TValue)
  Dictionary<TKey, TValue>.Clear()
  Dictionary<TKey, TValue>.ContainsKey(TKey)
  Dictionary<TKey, TValue>.ContainsValue(TValue)
  Dictionary<TKey, TValue>.EnsureCapacity(int)
  Dictionary<TKey, TValue>.GetEnumerator()
  Dictionary<TKey, TValue>.OnDeserialization(object)
  Dictionary<TKey, TValue>.Remove(TKey)
  Dictionary<TKey, TValue>.Remove(TKey, out TValue)
  Dictionary<TKey, TValue>.TrimExcess()
  Dictionary<TKey, TValue>.TrimExcess(int)
  Dictionary<TKey, TValue>.TryAdd(TKey, TValue)
  Dictionary<TKey, TValue>.TryGetValue(TKey, out TValue)
  Dictionary<TKey, TValue>.Comparer
  Dictionary<TKey, TValue>.Count
  Dictionary<TKey, TValue>.this[TKey]
  Dictionary<TKey, TValue>.Keys
  Dictionary<TKey, TValue>.Values
  object.Equals(object)
  object.Equals(object, object)
  object.GetType()
  object.MemberwiseClone()
  object.ReferenceEquals(object, object)
  object.ToString()

Extension Methods
  DictionaryEx.GetValue<TK, TV>(IDictionary<TK, TV>, TK, TV?)
  DictionaryEx.ToListString<TK, TV>(IDictionary<TK, TV>, string, string)
  NumberUtils.IsNumber(object)
  NumberUtils.ToDouble(object)
  ObjectUtils.ToStr(object?)

## 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.