Beispiel #1
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 (Nickname != null)
         {
             hashCode = hashCode * 59 + Nickname.GetHashCode();
         }
         if (CountryId != null)
         {
             hashCode = hashCode * 59 + CountryId.GetHashCode();
         }
         if (Zip != null)
         {
             hashCode = hashCode * 59 + Zip.GetHashCode();
         }
         if (City != null)
         {
             hashCode = hashCode * 59 + City.GetHashCode();
         }
         if (AdministrativeArea != null)
         {
             hashCode = hashCode * 59 + AdministrativeArea.GetHashCode();
         }
         if (DependentLocality != null)
         {
             hashCode = hashCode * 59 + DependentLocality.GetHashCode();
         }
         if (SortingCode != null)
         {
             hashCode = hashCode * 59 + SortingCode.GetHashCode();
         }
         if (Organization != null)
         {
             hashCode = hashCode * 59 + Organization.GetHashCode();
         }
         if (AddressLine1 != null)
         {
             hashCode = hashCode * 59 + AddressLine1.GetHashCode();
         }
         if (AddressLine2 != null)
         {
             hashCode = hashCode * 59 + AddressLine2.GetHashCode();
         }
         if (IsPrimary != null)
         {
             hashCode = hashCode * 59 + IsPrimary.GetHashCode();
         }
         if (SessionToken != null)
         {
             hashCode = hashCode * 59 + SessionToken.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Revision != 0)
            {
                hash ^= Revision.GetHashCode();
            }
            if (RegionCode.Length != 0)
            {
                hash ^= RegionCode.GetHashCode();
            }
            if (LanguageCode.Length != 0)
            {
                hash ^= LanguageCode.GetHashCode();
            }
            if (PostalCode.Length != 0)
            {
                hash ^= PostalCode.GetHashCode();
            }
            if (SortingCode.Length != 0)
            {
                hash ^= SortingCode.GetHashCode();
            }
            if (AdministrativeArea.Length != 0)
            {
                hash ^= AdministrativeArea.GetHashCode();
            }
            if (Locality.Length != 0)
            {
                hash ^= Locality.GetHashCode();
            }
            if (Sublocality.Length != 0)
            {
                hash ^= Sublocality.GetHashCode();
            }
            hash ^= addressLines_.GetHashCode();
            hash ^= recipients_.GetHashCode();
            if (Organization.Length != 0)
            {
                hash ^= Organization.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }