public bool Equals(RaceDetails raceToCompareTo) { if ((object)raceToCompareTo == null) { return(false); } return((RaceDate == raceToCompareTo.RaceDate) && (RaceDistance == raceToCompareTo.RaceDistance) && (WonPlace == raceToCompareTo.WonPlace)); }
//overriding Equals for List Union public override bool Equals(object obj) { if (obj == null) { return(false); } RaceDetails r = obj as RaceDetails; if (r == null) { return(false); } return((RaceDate == r.RaceDate) && (RaceDistance == r.RaceDistance) && (WonPlace == r.WonPlace)); }