using System; using System.Collections.Generic; using System.Text; namespace DllEapEntity.Dtos { public class AlarmByDayComparer : IEqualityComparer { public bool Equals(McaEventStatisticByDay x, McaEventStatisticByDay y) { if (Object.ReferenceEquals(x, y)) return true; if (Object.ReferenceEquals(x, null) || Object.ReferenceEquals(y, null)) return false; return x.McaCode == y.McaCode && x.AlarmCode == y.AlarmCode && x.EventCode == y.EventCode && x.StartTime == y.StartTime && x.EndTime == y.EndTime; } public int GetHashCode(McaEventStatisticByDay obj) { if (Object.ReferenceEquals(obj, null)) return 0; int hashStudentName = obj.McaName == null ? 0 : obj.McaName.GetHashCode(); int hashStudentCode = obj.McaCode.GetHashCode(); return hashStudentName ^ hashStudentCode; } } }