/// <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 (AccountNumber != null)
         {
             hashCode = hashCode * 59 + AccountNumber.GetHashCode();
         }
         if (BankCode != null)
         {
             hashCode = hashCode * 59 + BankCode.GetHashCode();
         }
         if (BankName != null)
         {
             hashCode = hashCode * 59 + BankName.GetHashCode();
         }
         if (BranchCode != null)
         {
             hashCode = hashCode * 59 + BranchCode.GetHashCode();
         }
         if (CheckDigit != null)
         {
             hashCode = hashCode * 59 + CheckDigit.GetHashCode();
         }
         if (CountryCode != null)
         {
             hashCode = hashCode * 59 + CountryCode.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
0
        public override int GetHashCode()
        {
            int hashType      = Type == null ? 0 : Type.GetHashCode();
            int hashBankCode  = BankCode.GetHashCode();
            int hashAccountId = AccountId.GetHashCode();

            return(hashType ^ hashBankCode ^ hashAccountId);
        }