Creates an equality comparer from delegates.
public static EqualityComparer<T> CreateEqualityComparer<T>(Func<T?, T?, bool> equals)
| parameter | description |
|---|---|
| T | The type to compare. |
| equals | The equals delegate. |
The equality comparer.
If GetHashCode is called, it will throw a NotImplementedException.
Creates an equality comparer from delegates.
public static EqualityComparer<T> CreateEqualityComparer<T>(Func<T?, T?, bool> equals,
Func<T, int> getHashCode)
| parameter | description |
|---|---|
| T | The type to compare. |
| equals | The equals delegate. |
| getHashCode | The hash code delegate. |
The equality comparer.
If getHashCode is null and GetHashCode is called, it will throw a NotImplementedException.