Exemple #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 (PayeeAccountUType != null)
         {
             hashCode = hashCode * 59 + PayeeAccountUType.GetHashCode();
         }
         if (Account != null)
         {
             hashCode = hashCode * 59 + Account.GetHashCode();
         }
         if (Card != null)
         {
             hashCode = hashCode * 59 + Card.GetHashCode();
         }
         if (PayId != null)
         {
             hashCode = hashCode * 59 + PayId.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemple #2
0
        /// <summary>
        /// Returns true if BankingDomesticPayee instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingDomesticPayee to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingDomesticPayee other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     PayeeAccountUType == other.PayeeAccountUType ||
                     PayeeAccountUType != null &&
                     PayeeAccountUType.Equals(other.PayeeAccountUType)
                     ) &&
                 (
                     Account == other.Account ||
                     Account != null &&
                     Account.Equals(other.Account)
                 ) &&
                 (
                     Card == other.Card ||
                     Card != null &&
                     Card.Equals(other.Card)
                 ) &&
                 (
                     PayId == other.PayId ||
                     PayId != null &&
                     PayId.Equals(other.PayId)
                 ));
        }