public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Address1?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ (Address2?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (City?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (ProvinceStateCode?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (CountryCode?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (OtherCountry?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (PostalZipCode?.GetHashCode() ?? 0);
         return(hashCode);
     }
 }
        public override bool Equals(object obj)
        {
            var a = obj as Address;

            if (a == null)
            {
                return(false);
            }
            // Addresses can be equal even if the case differs or the leading/trailing whitespace differs
            return(
                string.Equals(Address1?.Trim(), a.Address1?.Trim(), StringComparison.OrdinalIgnoreCase) &&
                string.Equals(Address2?.Trim(), a.Address2?.Trim(), StringComparison.OrdinalIgnoreCase) &&
                string.Equals(City?.Trim(), a.City?.Trim(), StringComparison.OrdinalIgnoreCase) &&
                string.Equals(ProvinceStateCode?.Trim(), a.ProvinceStateCode?.Trim(), StringComparison.OrdinalIgnoreCase) &&
                string.Equals(CountryCode?.Trim(), a.CountryCode?.Trim(), StringComparison.OrdinalIgnoreCase) &&
                string.Equals(OtherCountry?.Trim(), a.OtherCountry?.Trim(), StringComparison.OrdinalIgnoreCase) &&
                string.Equals(PostalZipCode?.Trim(), a.PostalZipCode?.Trim(), StringComparison.OrdinalIgnoreCase)
                );
        }