/// <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 (OriginalStartDate != null) { hashCode = hashCode * 59 + OriginalStartDate.GetHashCode(); } if (OriginalLoanAmount != null) { hashCode = hashCode * 59 + OriginalLoanAmount.GetHashCode(); } if (OriginalLoanCurrency != null) { hashCode = hashCode * 59 + OriginalLoanCurrency.GetHashCode(); } if (LoanEndDate != null) { hashCode = hashCode * 59 + LoanEndDate.GetHashCode(); } if (NextInstalmentDate != null) { hashCode = hashCode * 59 + NextInstalmentDate.GetHashCode(); } if (MinInstalmentAmount != null) { hashCode = hashCode * 59 + MinInstalmentAmount.GetHashCode(); } if (MinInstalmentCurrency != null) { hashCode = hashCode * 59 + MinInstalmentCurrency.GetHashCode(); } if (MaxRedraw != null) { hashCode = hashCode * 59 + MaxRedraw.GetHashCode(); } if (MaxRedrawCurrency != null) { hashCode = hashCode * 59 + MaxRedrawCurrency.GetHashCode(); } if (MinRedraw != null) { hashCode = hashCode * 59 + MinRedraw.GetHashCode(); } if (MinRedrawCurrency != null) { hashCode = hashCode * 59 + MinRedrawCurrency.GetHashCode(); } if (OffsetAccountEnabled != null) { hashCode = hashCode * 59 + OffsetAccountEnabled.GetHashCode(); } if (OffsetAccountIds != null) { hashCode = hashCode * 59 + OffsetAccountIds.GetHashCode(); } if (RepaymentFrequency != null) { hashCode = hashCode * 59 + RepaymentFrequency.GetHashCode(); } if (RepaymentType != null) { hashCode = hashCode * 59 + RepaymentType.GetHashCode(); } if (LoanPurpose != null) { hashCode = hashCode * 59 + LoanPurpose.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if BankingLoanAccount instances are equal /// </summary> /// <param name="other">Instance of BankingLoanAccount to be compared</param> /// <returns>Boolean</returns> public bool Equals(BankingLoanAccount other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( OriginalStartDate == other.OriginalStartDate || OriginalStartDate != null && OriginalStartDate.Equals(other.OriginalStartDate) ) && ( OriginalLoanAmount == other.OriginalLoanAmount || OriginalLoanAmount != null && OriginalLoanAmount.Equals(other.OriginalLoanAmount) ) && ( OriginalLoanCurrency == other.OriginalLoanCurrency || OriginalLoanCurrency != null && OriginalLoanCurrency.Equals(other.OriginalLoanCurrency) ) && ( LoanEndDate == other.LoanEndDate || LoanEndDate != null && LoanEndDate.Equals(other.LoanEndDate) ) && ( NextInstalmentDate == other.NextInstalmentDate || NextInstalmentDate != null && NextInstalmentDate.Equals(other.NextInstalmentDate) ) && ( MinInstalmentAmount == other.MinInstalmentAmount || MinInstalmentAmount != null && MinInstalmentAmount.Equals(other.MinInstalmentAmount) ) && ( MinInstalmentCurrency == other.MinInstalmentCurrency || MinInstalmentCurrency != null && MinInstalmentCurrency.Equals(other.MinInstalmentCurrency) ) && ( MaxRedraw == other.MaxRedraw || MaxRedraw != null && MaxRedraw.Equals(other.MaxRedraw) ) && ( MaxRedrawCurrency == other.MaxRedrawCurrency || MaxRedrawCurrency != null && MaxRedrawCurrency.Equals(other.MaxRedrawCurrency) ) && ( MinRedraw == other.MinRedraw || MinRedraw != null && MinRedraw.Equals(other.MinRedraw) ) && ( MinRedrawCurrency == other.MinRedrawCurrency || MinRedrawCurrency != null && MinRedrawCurrency.Equals(other.MinRedrawCurrency) ) && ( OffsetAccountEnabled == other.OffsetAccountEnabled || OffsetAccountEnabled != null && OffsetAccountEnabled.Equals(other.OffsetAccountEnabled) ) && ( OffsetAccountIds == other.OffsetAccountIds || OffsetAccountIds != null && OffsetAccountIds.SequenceEqual(other.OffsetAccountIds) ) && ( RepaymentFrequency == other.RepaymentFrequency || RepaymentFrequency != null && RepaymentFrequency.Equals(other.RepaymentFrequency) ) && ( RepaymentType == other.RepaymentType || RepaymentType != null && RepaymentType.Equals(other.RepaymentType) ) && ( LoanPurpose == other.LoanPurpose || LoanPurpose != null && LoanPurpose.Equals(other.LoanPurpose) )); }