/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) hashCode = hashCode * 59 + IdCustomer.GetHashCode(); if (Firstname != null) { hashCode = hashCode * 59 + Firstname.GetHashCode(); } if (Lastname != null) { hashCode = hashCode * 59 + Lastname.GetHashCode(); } if (Address != null) { hashCode = hashCode * 59 + Address.GetHashCode(); } if (AddressNr != null) { hashCode = hashCode * 59 + AddressNr.GetHashCode(); } if (Place != null) { hashCode = hashCode * 59 + Place.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if Customer instances are equal /// </summary> /// <param name="other">Instance of Customer to be compared</param> /// <returns>Boolean</returns> public bool Equals(Customer other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( IdCustomer == other.IdCustomer || IdCustomer.Equals(other.IdCustomer) ) && ( Firstname == other.Firstname || Firstname != null && Firstname.Equals(other.Firstname) ) && ( Lastname == other.Lastname || Lastname != null && Lastname.Equals(other.Lastname) ) && ( Address == other.Address || Address != null && Address.Equals(other.Address) ) && ( AddressNr == other.AddressNr || AddressNr != null && AddressNr.Equals(other.AddressNr) ) && ( Place == other.Place || Place != null && Place.Equals(other.Place) )); }