/// <summary> /// Returns true if MandateSepaDirectDebit instances are equal /// </summary> /// <param name="other">Instance of MandateSepaDirectDebit to be compared</param> /// <returns>Boolean</returns> public bool Equals(MandateSepaDirectDebit other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Creditor == other.Creditor || Creditor != null && Creditor.Equals(other.Creditor) ) && ( MandateId == other.MandateId || MandateId != null && MandateId.Equals(other.MandateId) ) && ( BankAccountIban == other.BankAccountIban || BankAccountIban != null && BankAccountIban.Equals(other.BankAccountIban) ) && ( CustomerContractIdentifier == other.CustomerContractIdentifier || CustomerContractIdentifier != null && CustomerContractIdentifier.Equals(other.CustomerContractIdentifier) ) && ( Debtor == other.Debtor || Debtor != null && Debtor.Equals(other.Debtor) ) && ( IsRecurring == other.IsRecurring || IsRecurring != null && IsRecurring.Equals(other.IsRecurring) ) && ( MandateApproval == other.MandateApproval || MandateApproval != null && MandateApproval.Equals(other.MandateApproval) ) && ( PreNotification == other.PreNotification || PreNotification != null && PreNotification.Equals(other.PreNotification) )); }
/// <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 (Creditor != null) { hashCode = hashCode * 59 + Creditor.GetHashCode(); } if (MandateId != null) { hashCode = hashCode * 59 + MandateId.GetHashCode(); } if (BankAccountIban != null) { hashCode = hashCode * 59 + BankAccountIban.GetHashCode(); } if (CustomerContractIdentifier != null) { hashCode = hashCode * 59 + CustomerContractIdentifier.GetHashCode(); } if (Debtor != null) { hashCode = hashCode * 59 + Debtor.GetHashCode(); } if (IsRecurring != null) { hashCode = hashCode * 59 + IsRecurring.GetHashCode(); } if (MandateApproval != null) { hashCode = hashCode * 59 + MandateApproval.GetHashCode(); } if (PreNotification != null) { hashCode = hashCode * 59 + PreNotification.GetHashCode(); } return(hashCode); } }