public bool Equals(UserAreaModel uowpm) { //Check whether the compared object is null. if (Object.ReferenceEquals(uowpm, null)) { return(false); } //Check whether the compared object references the same data. if (Object.ReferenceEquals(this, uowpm)) { return(true); } //Check whether the objects properties are equal. return(UserId.Equals(uowpm.UserId) && AreaId.Equals(uowpm.AreaId)); }
protected bool Equals(AreaConsumptionReport other) { return(AreaId.Equals(other.AreaId) && CityConsumptionReports.Count == other.CityConsumptionReports.Count && CityConsumptionReports.All(report => other.CityConsumptionReports.Contains(report))); }