Exemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (ZipCode != null ? ZipCode.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StreetName != null ? StreetName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (BuildNumber != null ? BuildNumber.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (District != null ? District.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Complement != null ? Complement.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (City != null ? City.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (State != null ? State.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Country != null ? Country.GetHashCode() : 0);
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Returns the hash code of the CEP object.
        /// </summary>
        /// <returns>The CEP's hash code.</returns>
        public override int GetHashCode()
        {
            unchecked
            {
                int hashcode;

                const int baseHash       = 63689;
                const int baseMultiplier = 378551;

                hashcode = (baseHash * baseMultiplier) ^ ZipCode.GetHashCode();
                hashcode = (hashcode * baseMultiplier) ^ Address.GetHashCode();
                hashcode = (hashcode * baseMultiplier) ^ Complement.GetHashCode();
                hashcode = (hashcode * baseMultiplier) ^ Neighborhood.GetHashCode();
                hashcode = (hashcode * baseMultiplier) ^ City.GetHashCode();
                hashcode = (hashcode * baseMultiplier) ^ State.GetHashCode();
                hashcode = (hashcode * baseMultiplier) ^ Unity.GetHashCode();
                hashcode = (hashcode * baseMultiplier) ^ IBGE.GetHashCode();
                hashcode = (hashcode * baseMultiplier) ^ GIA.GetHashCode();

                return(hashcode);
            }
        }