Class MappedEqualityComparer<T, TMapped>
Compares instances of a type based on the output of a mapping function.
Inheritance
MappedEqualityComparer<T, TMapped>
Assembly: Recore.dll
Syntax
public sealed class MappedEqualityComparer<T, TMapped> : IEqualityComparer<T>
Type Parameters
Name |
Description |
T |
|
TMapped |
|
Constructors
|
Improve this Doc
View Source
MappedEqualityComparer(Func<T, TMapped>)
Declaration
public MappedEqualityComparer(Func<T, TMapped> mapping)
Parameters
Type |
Name |
Description |
Func<T, TMapped> |
mapping |
|
Methods
|
Improve this Doc
View Source
Equals(T, T)
Invokes the mapping function on two objects and checks if the outputs are equal.
Declaration
public bool Equals(T x, T y)
Parameters
Type |
Name |
Description |
T |
x |
|
T |
y |
|
Returns
|
Improve this Doc
View Source
GetHashCode(T)
Hashes the mapped output of an object.
Declaration
public int GetHashCode(T obj)
Parameters
Type |
Name |
Description |
T |
obj |
|
Returns
Implements
Extension Methods