/// <summary> /// Returns true if PhysicalAddress instances are equal /// </summary> /// <param name="other">Instance of PhysicalAddress to be compared</param> /// <returns>Boolean</returns> public bool Equals(PhysicalAddress other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( CountryId == other.CountryId || CountryId != null && CountryId.Equals(other.CountryId) ) && ( Zip == other.Zip || Zip != null && Zip.Equals(other.Zip) ) && ( City == other.City || City != null && City.Equals(other.City) ) && ( AdministrativeArea == other.AdministrativeArea || AdministrativeArea != null && AdministrativeArea.Equals(other.AdministrativeArea) ) && ( DependentLocality == other.DependentLocality || DependentLocality != null && DependentLocality.Equals(other.DependentLocality) ) && ( SortingCode == other.SortingCode || SortingCode != null && SortingCode.Equals(other.SortingCode) ) && ( Organization == other.Organization || Organization != null && Organization.Equals(other.Organization) ) && ( AddressLine1 == other.AddressLine1 || AddressLine1 != null && AddressLine1.Equals(other.AddressLine1) ) && ( AddressLine2 == other.AddressLine2 || AddressLine2 != null && AddressLine2.Equals(other.AddressLine2) )); }
public override bool Equals(object obj) { if (obj == this) { return(true); } if (!(obj is AddressData addressData)) { return(false); } return((PostalCountry == null ? addressData.PostalCountry == null : PostalCountry.Equals(addressData.PostalCountry)) && (!AddressLines.Any() ? !addressData.AddressLines.Any() : AddressLines.Equals(addressData.AddressLines)) && (AdministrativeArea == null ? addressData.AdministrativeArea == null : AdministrativeArea.Equals(addressData.AdministrativeArea)) && (Locality == null ? addressData.Locality == null : Locality.Equals(addressData.Locality)) && (DependentLocality == null ? addressData.DependentLocality == null : DependentLocality.Equals(addressData.DependentLocality)) && (PostalCode == null ? addressData.PostalCode == null : PostalCode.Equals(addressData.PostalCode)) && (SortingCode == null ? addressData.SortingCode == null : SortingCode.Equals(addressData.SortingCode)) && (Organization == null ? addressData.Organization == null : Organization.Equals(addressData.Organization)) && (Recipient == null ? addressData.Recipient == null : Recipient.Equals(addressData.Recipient)) && (LanguageCode == null ? addressData.LanguageCode == null : LanguageCode.Equals(addressData.LanguageCode))); }
/// <summary> /// Returns true if AddressesModel2 instances are equal /// </summary> /// <param name="other">Instance of AddressesModel2 to be compared</param> /// <returns>Boolean</returns> public bool Equals(AddressesModel2 other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( AddressId == other.AddressId || AddressId != null && AddressId.Equals(other.AddressId) ) && ( Nickname == other.Nickname || Nickname != null && Nickname.Equals(other.Nickname) ) && ( CountryId == other.CountryId || CountryId != null && CountryId.Equals(other.CountryId) ) && ( Zip == other.Zip || Zip != null && Zip.Equals(other.Zip) ) && ( City == other.City || City != null && City.Equals(other.City) ) && ( AdministrativeArea == other.AdministrativeArea || AdministrativeArea != null && AdministrativeArea.Equals(other.AdministrativeArea) ) && ( DependentLocality == other.DependentLocality || DependentLocality != null && DependentLocality.Equals(other.DependentLocality) ) && ( SortingCode == other.SortingCode || SortingCode != null && SortingCode.Equals(other.SortingCode) ) && ( Organization == other.Organization || Organization != null && Organization.Equals(other.Organization) ) && ( AddressLine1 == other.AddressLine1 || AddressLine1 != null && AddressLine1.Equals(other.AddressLine1) ) && ( AddressLine2 == other.AddressLine2 || AddressLine2 != null && AddressLine2.Equals(other.AddressLine2) ) && ( IsPrimary == other.IsPrimary || IsPrimary != null && IsPrimary.Equals(other.IsPrimary) ) && ( SessionToken == other.SessionToken || SessionToken != null && SessionToken.Equals(other.SessionToken) )); }