コード例 #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 (BillingAddress != null)
         {
             hashCode = hashCode * 59 + BillingAddress.GetHashCode();
         }
         if (ContactDetails != null)
         {
             hashCode = hashCode * 59 + ContactDetails.GetHashCode();
         }
         if (FiscalNumber != null)
         {
             hashCode = hashCode * 59 + FiscalNumber.GetHashCode();
         }
         if (Locale != null)
         {
             hashCode = hashCode * 59 + Locale.GetHashCode();
         }
         if (PersonalInformation != null)
         {
             hashCode = hashCode * 59 + PersonalInformation.GetHashCode();
         }
         if (ShippingAddress != null)
         {
             hashCode = hashCode * 59 + ShippingAddress.GetHashCode();
         }
         return(hashCode);
     }
 }