Equals, GetHashCode, EqualityComparers and fuzzy equality
For an object with properties A, B, C, D, StartDate and EndDate if I wanted to implement something where any two objects are equal if they have identical A, B and C and overlapping date range, how would that be done? I have tried creating an EqualityComparer like so public override bool Equals(RateItem x, RateItem y) { bool equal = true; if ((x.A != y.A || x.B != y.B || x.C != y.C || (x.StartDate < y.StartDate && x.EndDate <= y.StartDate) || (x.StartDate > y.StartDate && y.EndDate <= x.StartDate))) { equal = false; } return equal; } But it seems lots of places in the framework ignore Equals