Being somewhat lazy about implementing lots of IEqualityComparers, and given that I couldn\'t easily edit class implementations of object being compared, I went with the fol
I needed to rewrite Henrik solution as a class implementing IEqualityComparer which gives this:
public class GenericEqualityComparer : IEqualityComparer
{
private readonly Func _keyFunction;
public GenericEqualityComparer(Func keyFunction)
{
_keyFunction = keyFunction;
}
public bool Equals(T x, T y) => EqualityComparer.Default.Equals(_keyFunction(x), _keyFunction(y));
public int GetHashCode(T obj)=> EqualityComparer.Default.GetHashCode(_keyFunction(obj));
}