Ejemplo n.º 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 (AccountId != null)
         {
             hashCode = hashCode * 59 + AccountId.GetHashCode();
         }
         if (AuthorisedEntity != null)
         {
             hashCode = hashCode * 59 + AuthorisedEntity.GetHashCode();
         }
         if (LastDebitDateTime != null)
         {
             hashCode = hashCode * 59 + LastDebitDateTime.GetHashCode();
         }
         if (LastDebitAmount != null)
         {
             hashCode = hashCode * 59 + LastDebitAmount.GetHashCode();
         }
         return(hashCode);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns true if BankingDirectDebit instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingDirectDebit to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingDirectDebit other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AccountId == other.AccountId ||
                     AccountId != null &&
                     AccountId.Equals(other.AccountId)
                     ) &&
                 (
                     AuthorisedEntity == other.AuthorisedEntity ||
                     AuthorisedEntity != null &&
                     AuthorisedEntity.Equals(other.AuthorisedEntity)
                 ) &&
                 (
                     LastDebitDateTime == other.LastDebitDateTime ||
                     LastDebitDateTime != null &&
                     LastDebitDateTime.Equals(other.LastDebitDateTime)
                 ) &&
                 (
                     LastDebitAmount == other.LastDebitAmount ||
                     LastDebitAmount != null &&
                     LastDebitAmount.Equals(other.LastDebitAmount)
                 ));
        }