Update* I am so sorry... my sample code contained an error which resulted in a lot of answers I didn\'t understand. In stead of
Console.WriteLin
You can either implement IEquatable
Make sure that value
you check for equality is immutable and is set only at initialization of the class.
Another consideration would be to implement IComparer
Once you'll properly implement IEquatable
Update:
Calling return EqualityComparer
would basically return same result since there is no IEqualityComparer
implemented...