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

            return
                ((
                     MinPaymentAmount == other.MinPaymentAmount ||
                     MinPaymentAmount != null &&
                     MinPaymentAmount.Equals(other.MinPaymentAmount)
                     ) &&
                 (
                     PaymentDueAmount == other.PaymentDueAmount ||
                     PaymentDueAmount != null &&
                     PaymentDueAmount.Equals(other.PaymentDueAmount)
                 ) &&
                 (
                     PaymentCurrency == other.PaymentCurrency ||
                     PaymentCurrency != null &&
                     PaymentCurrency.Equals(other.PaymentCurrency)
                 ) &&
                 (
                     PaymentDueDate == other.PaymentDueDate ||
                     PaymentDueDate != null &&
                     PaymentDueDate.Equals(other.PaymentDueDate)
                 ));
        }