According to MSDN, a hash function must have the following properties:
If two objects compare as equal, the GetHashCode method for each object m
public override int GetHashCode() { return IntProp1 ^ IntProp2 ^ StrProp3.GetHashCode() ^ StrProp4.GetHashCode ^ CustomClassProp.GetHashCode; }
Do the same in the customClass's GetHasCode method. Works like a charm.
GetHasCode