Concerning IEqualityComparer, is there ever a reason why the Equals(T x, T y)
implementation should be anything other than what I have below?
public class MyEquality : IEqualityComparer<MyType>
{
//My Equals(T x, T y) always looks like this
public bool Equals(MyType x, MyType y)
{
return this.GetHashCode(x).Equals(this.GetHashCode(y));
}
public int GetHashCode(MyType obj)
{
//assume MyType has a non-nullable member called ID
return obj.ID.GetHashCode();
}
}