/// <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 (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Status != null)
         {
             hashCode = hashCode * 59 + Status.GetHashCode();
         }
         if (StatusReason != null)
         {
             hashCode = hashCode * 59 + StatusReason.GetHashCode();
         }
         if (ValidFor != null)
         {
             hashCode = hashCode * 59 + ValidFor.GetHashCode();
         }
         if (EngagedParty != null)
         {
             hashCode = hashCode * 59 + EngagedParty.GetHashCode();
         }
         if (PartyRoleType != null)
         {
             hashCode = hashCode * 59 + PartyRoleType.GetHashCode();
         }
         if (Account != null)
         {
             hashCode = hashCode * 59 + Account.GetHashCode();
         }
         if (Characteristic != null)
         {
             hashCode = hashCode * 59 + Characteristic.GetHashCode();
         }
         if (CreditProfile != null)
         {
             hashCode = hashCode * 59 + CreditProfile.GetHashCode();
         }
         if (Agreement != null)
         {
             hashCode = hashCode * 59 + Agreement.GetHashCode();
         }
         if (RelatedParty != null)
         {
             hashCode = hashCode * 59 + RelatedParty.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (BillingAddress != null ? BillingAddress.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CardBrand != null ? CardBrand.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CardExpMonth.GetHashCode();
         hashCode = (hashCode * 397) ^ CardExpYear.GetHashCode();
         hashCode = (hashCode * 397) ^ (CardLast4 != null ? CardLast4.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CustomerId.GetHashCode();
         hashCode = (hashCode * 397) ^ HasCardErrorInDunning.GetHashCode();
         hashCode = (hashCode * 397) ^ (PaymentType != null ? PaymentType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (ProcessorName != null ? ProcessorName.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StatusReason != null ? StatusReason.GetHashCode() : 0);
         return(hashCode);
     }
 }