/// <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 :) if (AdditionalAddressInfo != null) { hashCode = hashCode * 59 + AdditionalAddressInfo.GetHashCode(); } if (City != null) { hashCode = hashCode * 59 + City.GetHashCode(); } if (CountryCode != null) { hashCode = hashCode * 59 + CountryCode.GetHashCode(); } if (HouseNumber != null) { hashCode = hashCode * 59 + HouseNumber.GetHashCode(); } if (Iban != null) { hashCode = hashCode * 59 + Iban.GetHashCode(); } if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (ReferenceParty != null) { hashCode = hashCode * 59 + ReferenceParty.GetHashCode(); } if (ReferencePartyId != null) { hashCode = hashCode * 59 + ReferencePartyId.GetHashCode(); } if (Street != null) { hashCode = hashCode * 59 + Street.GetHashCode(); } if (Zip != null) { hashCode = hashCode * 59 + Zip.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if Creditor instances are equal /// </summary> /// <param name="other">Instance of Creditor to be compared</param> /// <returns>Boolean</returns> public bool Equals(Creditor other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( AdditionalAddressInfo == other.AdditionalAddressInfo || AdditionalAddressInfo != null && AdditionalAddressInfo.Equals(other.AdditionalAddressInfo) ) && ( City == other.City || City != null && City.Equals(other.City) ) && ( CountryCode == other.CountryCode || CountryCode != null && CountryCode.Equals(other.CountryCode) ) && ( HouseNumber == other.HouseNumber || HouseNumber != null && HouseNumber.Equals(other.HouseNumber) ) && ( Iban == other.Iban || Iban != null && Iban.Equals(other.Iban) ) && ( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Name == other.Name || Name != null && Name.Equals(other.Name) ) && ( ReferenceParty == other.ReferenceParty || ReferenceParty != null && ReferenceParty.Equals(other.ReferenceParty) ) && ( ReferencePartyId == other.ReferencePartyId || ReferencePartyId != null && ReferencePartyId.Equals(other.ReferencePartyId) ) && ( Street == other.Street || Street != null && Street.Equals(other.Street) ) && ( Zip == other.Zip || Zip != null && Zip.Equals(other.Zip) )); }