I\'m looking for real world best practices, how other people might have implemented solutions with complex domains.
This is what MSDN has to say about IEqualityComparer (non-generic):
This interface allows the implementation of customized equality comparison for collections. That is, you can create your own definition of equality, and specify that this definition be used with a collection type that accepts the
IEqualityComparerinterface. In the .NET Framework, constructors of theHashtable,NameValueCollection, andOrderedDictionarycollection types accept this interface.This interface supports only equality comparisons. Customization of comparisons for sorting and ordering is provided by the
IComparerinterface.
It looks like the generic version of this interface performs the same function but is used for Dictionary<(Of <(TKey, TValue>)>) collections.
As far as best practices around using this interface for your own purposes. I would say that the best practice would be to use it when you are deriving or implementing a class that has similar functionality to the above mentioned .NET framework collections and where you want to add the same capability to your own collections. This will ensure that you are consistent with how the .NET framework uses the interface.
In other words support the use of this interface if you are developing a custom collection and you want to allow your consumers to control equality which is used in a number of LINQ and collection related methods (eg. Sort).