/// <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 (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (CurrencyCode != null) { hashCode = hashCode * 59 + CurrencyCode.GetHashCode(); } if (Amount != null) { hashCode = hashCode * 59 + Amount.GetHashCode(); } if (CVC != null) { hashCode = hashCode * 59 + CVC.GetHashCode(); } if (CardNumber != null) { hashCode = hashCode * 59 + CardNumber.GetHashCode(); } if (FullName != null) { hashCode = hashCode * 59 + FullName.GetHashCode(); } if (CardExpiryDate != null) { hashCode = hashCode * 59 + CardExpiryDate.GetHashCode(); } if (RequestDate != null) { hashCode = hashCode * 59 + RequestDate.GetHashCode(); } if (SendingBankName != null) { hashCode = hashCode * 59 + SendingBankName.GetHashCode(); } if (RecievingBankName != null) { hashCode = hashCode * 59 + RecievingBankName.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if PaymentRequest instances are equal /// </summary> /// <param name="other">Instance of PaymentRequest to be compared</param> /// <returns>Boolean</returns> public bool Equals(PaymentRequest other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( CurrencyCode == other.CurrencyCode || CurrencyCode != null && CurrencyCode.Equals(other.CurrencyCode) ) && ( Amount == other.Amount || Amount != null && Amount.Equals(other.Amount) ) && ( CVC == other.CVC || CVC != null && CVC.Equals(other.CVC) ) && ( CardNumber == other.CardNumber || CardNumber != null && CardNumber.Equals(other.CardNumber) ) && ( FullName == other.FullName || FullName != null && FullName.Equals(other.FullName) ) && ( CardExpiryDate == other.CardExpiryDate || CardExpiryDate != null && CardExpiryDate.Equals(other.CardExpiryDate) ) && ( RequestDate == other.RequestDate || RequestDate != null && RequestDate.Equals(other.RequestDate) ) && ( SendingBankName == other.SendingBankName || SendingBankName != null && SendingBankName.Equals(other.SendingBankName) ) && ( RecievingBankName == other.RecievingBankName || RecievingBankName != null && RecievingBankName.Equals(other.RecievingBankName) )); }