NanoByte.Common  2.7.0
NanoByte.Common.Values.KeyEqualityComparer< T, TKey > Class Template Reference

Specifies the equality of objects based on the equality of a key extracted from the objects. More...

Inheritance diagram for NanoByte.Common.Values.KeyEqualityComparer< T, TKey >:

Public Member Functions

 KeyEqualityComparer (Func< T, TKey > keySelector)
 Creates a new key equality comparer. More...
 
bool Equals (T? x, T? y)
 
int GetHashCode (T obj)
 

Detailed Description

Specifies the equality of objects based on the equality of a key extracted from the objects.

Template Parameters
TThe type of objects to compare.
TKeyThe type of the key to use to determine equality.
Type Constraints
T :notnull 
TKey :notnull 

Constructor & Destructor Documentation

◆ KeyEqualityComparer()

NanoByte.Common.Values.KeyEqualityComparer< T, TKey >.KeyEqualityComparer ( Func< T, TKey >  keySelector)
inline

Creates a new key equality comparer.

Parameters
keySelectorA function mapping objects to their respective equality keys.

The documentation for this class was generated from the following file: