Пример #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 (BankId != null)
         {
             hashCode = hashCode * 59 + BankId.GetHashCode();
         }
         if (AccountNumber != null)
         {
             hashCode = hashCode * 59 + AccountNumber.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
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 (AccountId != null)
         {
             hashCode = hashCode * 59 + AccountId.GetHashCode();
         }
         if (BankId != null)
         {
             hashCode = hashCode * 59 + BankId.GetHashCode();
         }
         if (AccountNumber != null)
         {
             hashCode = hashCode * 59 + AccountNumber.GetHashCode();
         }
         if (SortCode != null)
         {
             hashCode = hashCode * 59 + SortCode.GetHashCode();
         }
         if (AccountName != null)
         {
             hashCode = hashCode * 59 + AccountName.GetHashCode();
         }
         if (CurrentBalance != null)
         {
             hashCode = hashCode * 59 + CurrentBalance.GetHashCode();
         }
         if (OverdraftLimit != null)
         {
             hashCode = hashCode * 59 + OverdraftLimit.GetHashCode();
         }
         return(hashCode);
     }
 }