Generic IEqualityComparer<T> and GetHashCode
问题 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 following, meant to be used with Distinct() and Except() extension methods. : public class GenericEqualityComparer<T> : IEqualityComparer<T> { Func<T, T, bool> compareFunction; Func<T, int> hashFunction; public GenericEqualityComparer(Func<T, T, bool> compareFunction, Func<T, int> hashFunction) { this.compareFunction =