Hashsets and different instances of class with all members identical
18:02 21 Aug 2009

Let's say I have a class called myclass.

In my code I have two instances of myclass, myclass1 and myclass2. Everything about them is (public and private) properties are identical.

If I try to add both of them to a HashSet will it add both or only one? If it adds both and I don't want it to, can I overidde equals in the myclass definition and the HasSet will know how to use it?

.net equality hashset iequalitycomparer