コード例 #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (_postcode != null ? _postcode.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AddressLine1 != null ? AddressLine1.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AddressLine2 != null ? AddressLine2.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AddressLine3 != null ? AddressLine3.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (AddressLine4 != null ? AddressLine4.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Uprn != null ? Uprn.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (GeoPoint != null ? GeoPoint.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #2
0
        public override int GetHashCode()
        {
            unchecked
            {
                const int hashBase   = (int)2166136261;
                const int multiplier = 16777619;

                int hash = hashBase;
                hash = (hash * multiplier) ^ (ContactName is null ? 0 : ContactName.GetHashCode());
                hash = (hash * multiplier) ^ (Department is null ? 0 : Department.GetHashCode());
                hash = (hash * multiplier) ^ (Organisation is null ? 0 : Organisation.GetHashCode());
                hash = (hash * multiplier) ^ (AddressLine1 is null ? 0 : AddressLine1.GetHashCode());
                hash = (hash * multiplier) ^ (AddressLine2 is null ? 0 : AddressLine2.GetHashCode());
                hash = (hash * multiplier) ^ (AddressLine3 is null ? 0 : AddressLine3.GetHashCode());
                hash = (hash * multiplier) ^ (City is null ? 0 : City.GetHashCode());
                hash = (hash * multiplier) ^ (PostCode is null ? 0 : PostCode.GetHashCode());

                return(hash);
            }
        }
コード例 #3
0
 /// <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 (MailingName != null)
         {
             hashCode = hashCode * 59 + MailingName.GetHashCode();
         }
         if (AddressLine1 != null)
         {
             hashCode = hashCode * 59 + AddressLine1.GetHashCode();
         }
         if (AddressLine2 != null)
         {
             hashCode = hashCode * 59 + AddressLine2.GetHashCode();
         }
         if (AddressLine3 != null)
         {
             hashCode = hashCode * 59 + AddressLine3.GetHashCode();
         }
         if (Postcode != null)
         {
             hashCode = hashCode * 59 + Postcode.GetHashCode();
         }
         if (City != null)
         {
             hashCode = hashCode * 59 + City.GetHashCode();
         }
         if (State != null)
         {
             hashCode = hashCode * 59 + State.GetHashCode();
         }
         if (Country != null)
         {
             hashCode = hashCode * 59 + Country.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #4
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (AddressLine1.Length != 0)
            {
                hash ^= AddressLine1.GetHashCode();
            }
            if (AddressLine2.Length != 0)
            {
                hash ^= AddressLine2.GetHashCode();
            }
            if (AddressLine3.Length != 0)
            {
                hash ^= AddressLine3.GetHashCode();
            }
            if (City.Length != 0)
            {
                hash ^= City.GetHashCode();
            }
            if (State.Length != 0)
            {
                hash ^= State.GetHashCode();
            }
            if (ZipCode.Length != 0)
            {
                hash ^= ZipCode.GetHashCode();
            }
            if (CountryCode.Length != 0)
            {
                hash ^= CountryCode.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #5
0
        public override int GetHashCode()
        {
            int hashCode = -1623438759;

            if (AddressLine1 != null)
            {
                hashCode += AddressLine1.GetHashCode();
            }

            if (AddressLine2 != null)
            {
                hashCode += AddressLine2.GetHashCode();
            }

            if (AddressLine3 != null)
            {
                hashCode += AddressLine3.GetHashCode();
            }

            if (Locality != null)
            {
                hashCode += Locality.GetHashCode();
            }

            if (Sublocality != null)
            {
                hashCode += Sublocality.GetHashCode();
            }

            if (Sublocality2 != null)
            {
                hashCode += Sublocality2.GetHashCode();
            }

            if (Sublocality3 != null)
            {
                hashCode += Sublocality3.GetHashCode();
            }

            if (AdministrativeDistrictLevel1 != null)
            {
                hashCode += AdministrativeDistrictLevel1.GetHashCode();
            }

            if (AdministrativeDistrictLevel2 != null)
            {
                hashCode += AdministrativeDistrictLevel2.GetHashCode();
            }

            if (AdministrativeDistrictLevel3 != null)
            {
                hashCode += AdministrativeDistrictLevel3.GetHashCode();
            }

            if (PostalCode != null)
            {
                hashCode += PostalCode.GetHashCode();
            }

            if (Country != null)
            {
                hashCode += Country.GetHashCode();
            }

            if (FirstName != null)
            {
                hashCode += FirstName.GetHashCode();
            }

            if (LastName != null)
            {
                hashCode += LastName.GetHashCode();
            }

            if (Organization != null)
            {
                hashCode += Organization.GetHashCode();
            }

            return(hashCode);
        }