public override int GetHashCode()
        {
            int hash = 1;

            if (StreetName.Length != 0)
            {
                hash ^= StreetName.GetHashCode();
            }
            if (BuildingNumber != 0)
            {
                hash ^= BuildingNumber.GetHashCode();
            }
            if (AddressLine.Length != 0)
            {
                hash ^= AddressLine.GetHashCode();
            }
            if (PostCode.Length != 0)
            {
                hash ^= PostCode.GetHashCode();
            }
            if (TownName.Length != 0)
            {
                hash ^= TownName.GetHashCode();
            }
            if (Country.Length != 0)
            {
                hash ^= Country.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
 /// <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 (Address != null)
         {
             hashCode = hashCode * 59 + Address.GetHashCode();
         }
         if (AdditionalInfo != null)
         {
             hashCode = hashCode * 59 + AdditionalInfo.GetHashCode();
         }
         if (DistrictName != null)
         {
             hashCode = hashCode * 59 + DistrictName.GetHashCode();
         }
         if (TownName != null)
         {
             hashCode = hashCode * 59 + TownName.GetHashCode();
         }
         if (IbgeCode != null)
         {
             hashCode = hashCode * 59 + IbgeCode.GetHashCode();
         }
         if (CountrySubDivision != null)
         {
             hashCode = hashCode * 59 + CountrySubDivision.GetHashCode();
         }
         if (PostCode != null)
         {
             hashCode = hashCode * 59 + PostCode.GetHashCode();
         }
         if (Country != null)
         {
             hashCode = hashCode * 59 + Country.GetHashCode();
         }
         if (CountryCode != null)
         {
             hashCode = hashCode * 59 + CountryCode.GetHashCode();
         }
         if (GeographicCoordinates != null)
         {
             hashCode = hashCode * 59 + GeographicCoordinates.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 3
0
 public override int GetHashCode()
 {
     return(TownName != null ? TownName.GetHashCode() : 0);
 }