/// <summary> /// Override of the equality method. /// </summary> /// <param name="o"></param> /// <returns></returns> public bool Equals(Meals o) { //Check whether the compared object is null. if (ReferenceEquals(o, null)) { return(false); } //Check whether the compared object references the same data. if (ReferenceEquals(this, o)) { return(true); } //Check whether the Meals' properties are equal. return(_id.Equals(o._id) && NumberOfPeople.Equals(o.NumberOfPeople) && Type.Equals(o.Type)); }