/// <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 (LodgementDate != null) { hashCode = hashCode * 59 + LodgementDate.GetHashCode(); } if (MaturityDate != null) { hashCode = hashCode * 59 + MaturityDate.GetHashCode(); } if (MaturityAmount != null) { hashCode = hashCode * 59 + MaturityAmount.GetHashCode(); } if (MaturityCurrency != null) { hashCode = hashCode * 59 + MaturityCurrency.GetHashCode(); } if (MaturityInstructions != null) { hashCode = hashCode * 59 + MaturityInstructions.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if BankingTermDepositAccount instances are equal /// </summary> /// <param name="other">Instance of BankingTermDepositAccount to be compared</param> /// <returns>Boolean</returns> public bool Equals(BankingTermDepositAccount other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( LodgementDate == other.LodgementDate || LodgementDate != null && LodgementDate.Equals(other.LodgementDate) ) && ( MaturityDate == other.MaturityDate || MaturityDate != null && MaturityDate.Equals(other.MaturityDate) ) && ( MaturityAmount == other.MaturityAmount || MaturityAmount != null && MaturityAmount.Equals(other.MaturityAmount) ) && ( MaturityCurrency == other.MaturityCurrency || MaturityCurrency != null && MaturityCurrency.Equals(other.MaturityCurrency) ) && ( MaturityInstructions == other.MaturityInstructions || MaturityInstructions != null && MaturityInstructions.Equals(other.MaturityInstructions) )); }