I asked a question here : When To Use IEquatable And Why about using IEquatable.
From the msdn:
The IEquatable(T) interface is used by generic collection objects such as Dictionary(TKey, TValue), List(T), and LinkedList(T) when testing for equality in such methods as Contains, IndexOf, LastIndexOf, and Remove.
If you dont implement that interface what exactly happens?? Exception / default object equals / ref equals?
Here’s one example:
Now comment the
IEquatable<Foo>implementation and run the program again.