I have a class similar to below:
class Abc { public string A {get;set;} public string B {get;set;} } The criteria for equals is if any of A or B matches two objects of class Abc should match.
public override bool Equals (Abc obj) { if (obj.A == A || obj.B == B) return true; else return false; } Can anyone let me know what kind of GetHashCode function would give equal values in such cases.
Because both A & B fields may or may not have same values.
Equalsmethod - it must be&&, not||.||.