Class KeyEqualityComparer<T, TKey>
Specifies the equality of objects based on the equality of a key extracted from the objects.
Inheritance
KeyEqualityComparer<T, TKey>
Assembly: NanoByte.Common.dll
Syntax
public class KeyEqualityComparer<T, TKey> : Object
Type Parameters
Name |
Description |
T |
The type of objects to compare.
|
TKey |
The type of the key to use to determine equality.
|
Constructors
KeyEqualityComparer(Func<T, TKey>)
Specifies the equality of objects based on the equality of a key extracted from the objects.
Declaration
public KeyEqualityComparer(Func<T, TKey> keySelector)
Parameters
Type |
Name |
Description |
Func<T, TKey> |
keySelector |
A function mapping objects to their respective equality keys.
|
Methods
Equals(T, T)
Declaration
public bool Equals(T x, T y)
Parameters
Type |
Name |
Description |
T |
x |
|
T |
y |
|
Returns
GetHashCode(T)
Declaration
public int GetHashCode(T obj)
Parameters
Type |
Name |
Description |
T |
obj |
|
Returns
Extension Methods