public bool Equals(Transaction?other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(TransactionID.Equals(other.TransactionID)); }
public override bool Equals(object?obj) { if (ReferenceEquals(null, obj)) { return(false); } if (ReferenceEquals(this, obj)) { return(true); } if (obj.GetType() != typeof(Transaction)) { return(false); } return(TransactionID.Equals((obj as Transaction).TransactionID)); }
/// <summary> /// Returns true if Transaction instances are equal /// </summary> /// <param name="other">Instance of Transaction to be compared</param> /// <returns>Boolean</returns> public bool Equals(Transaction other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( TransactionID == other.TransactionID || TransactionID != null && TransactionID.Equals(other.TransactionID) ) && ( BuyerFirstName == other.BuyerFirstName || BuyerFirstName != null && BuyerFirstName.Equals(other.BuyerFirstName) ) && ( BuyerLastName == other.BuyerLastName || BuyerLastName != null && BuyerLastName.Equals(other.BuyerLastName) ) && ( BuyerAddress == other.BuyerAddress || BuyerAddress != null && BuyerAddress.Equals(other.BuyerAddress) ) && ( BuyerCity == other.BuyerCity || BuyerCity != null && BuyerCity.Equals(other.BuyerCity) ) && ( BuyerEmail == other.BuyerEmail || BuyerEmail != null && BuyerEmail.Equals(other.BuyerEmail) ) && ( BuyerUserId == other.BuyerUserId || BuyerUserId != null && BuyerUserId.Equals(other.BuyerUserId) ) && ( PaymentStatus == other.PaymentStatus || PaymentStatus != null && PaymentStatus.Equals(other.PaymentStatus) ) && ( PaymentReferenceId == other.PaymentReferenceId || PaymentReferenceId != null && PaymentReferenceId.Equals(other.PaymentReferenceId) ) && ( TotalAmount == other.TotalAmount || TotalAmount != null && TotalAmount.Equals(other.TotalAmount) )); }