There seem to be a lot of equation interfaces: IEquatable
, IEquatable<T>
, IEqualityComparer
, IEqualityComparer<T>
. Which one should I implement to be able to detect if two objects have the same value (while my object decides what the same value means).
And I want this to be possible not just for two objects of the known same type, but also for two objects of which one is my known type, and even for collections of two objects, even if they are of unknown origin, for instance IList
and IEnumerable
(both the not generic type, so without the <T>
)
What is the proper way to do this?