IEqualityComparerTKey
IEqualityComparerTKey is not the canonical name used in the standard API; in the widely used .NET libraries the generic interface is IEqualityComparer<TKey>. The term IEqualityComparerTKey may appear as a shorthand or misnomer for that interface, but the official API defines it as IEqualityComparer<TKey>. This interface is used to supply custom logic for determining equality and computing hash codes for keys of type TKey.
The interface IEqualityComparer<TKey> defines two members: bool Equals(TKey x, TKey y) and int GetHashCode(TKey obj). Implementations
Usage of IEqualityComparer<TKey> occurs primarily with generic collections that rely on hashing, such as Dictionary<TKey, TValue>
Common patterns include using existing comparers provided by the framework (for example, StringComparer.OrdinalIgnoreCase for string keys)