/// <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);
     }
 }
Example #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (AccountNumber != null ? AccountNumber.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (BranchCode != null ? BranchCode.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ BankAccountType.GetHashCode();
         return(hashCode);
     }
 }