Equals(T x, T y)
IEqualityComparer に関して、実装が以下のもの以外のものでなければならない理由はありますか?
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();
}
}