public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is TerminalCheckout other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((AmountMoney == null && other.AmountMoney == null) || (AmountMoney?.Equals(other.AmountMoney) == true)) &&
                   ((ReferenceId == null && other.ReferenceId == null) || (ReferenceId?.Equals(other.ReferenceId) == true)) &&
                   ((Note == null && other.Note == null) || (Note?.Equals(other.Note) == true)) &&
                   ((DeviceOptions == null && other.DeviceOptions == null) || (DeviceOptions?.Equals(other.DeviceOptions) == true)) &&
                   ((DeadlineDuration == null && other.DeadlineDuration == null) || (DeadlineDuration?.Equals(other.DeadlineDuration) == true)) &&
                   ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) &&
                   ((CancelReason == null && other.CancelReason == null) || (CancelReason?.Equals(other.CancelReason) == true)) &&
                   ((PaymentIds == null && other.PaymentIds == null) || (PaymentIds?.Equals(other.PaymentIds) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)));
        }
Ejemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (!(obj is Conversion))
            {
                return(false);
            }

            var conversion = obj as Conversion;

            return(Id == conversion.Id &&
                   AccountId == conversion.AccountId &&
                   CreatorContactId == conversion.CreatorContactId &&
                   ShortReference == conversion.ShortReference &&
                   SettlementDate == conversion.SettlementDate &&
                   ConversionDate == conversion.ConversionDate &&
                   Status == conversion.Status &&
                   PartnerStatus == conversion.PartnerStatus &&
                   CurrencyPair == conversion.CurrencyPair &&
                   BuyCurrency == conversion.BuyCurrency &&
                   AccountId == conversion.AccountId &&
                   SellCurrency == conversion.SellCurrency &&
                   FixedSide == conversion.FixedSide &&
                   PartnerBuyAmount == conversion.PartnerBuyAmount &&
                   PartnerSellAmount == conversion.PartnerSellAmount &&
                   ClientBuyAmount == conversion.ClientBuyAmount &&
                   ClientSellAmount == conversion.ClientSellAmount &&
                   MidMarketRate == conversion.MidMarketRate &&
                   CoreRate == conversion.CoreRate &&
                   PartnerRate == conversion.PartnerRate &&
                   ClientRate == conversion.ClientRate &&
                   DepositRequired == conversion.DepositRequired &&
                   DepositAmount == conversion.DepositAmount &&
                   DepositCurrency == conversion.DepositCurrency &&
                   DepositStatus == conversion.DepositStatus &&
                   DepositRequiredAt == conversion.DepositRequiredAt &&
                   PaymentIds.SequenceEqual(conversion.PaymentIds) &&
                   CreatedAt == conversion.CreatedAt &&
                   UpdatedAt == conversion.UpdatedAt &&
                   UniqueRequestId == conversion.UniqueRequestId &&
                   UnallocatedFunds == conversion.UnallocatedFunds &&
                   Reason == conversion.Reason &&
                   ConversionDatePreference == conversion.ConversionDatePreference);
        }
        public override int GetHashCode()
        {
            int hashCode = -1408597552;

            if (Id != null)
            {
                hashCode += Id.GetHashCode();
            }

            if (AmountMoney != null)
            {
                hashCode += AmountMoney.GetHashCode();
            }

            if (ReferenceId != null)
            {
                hashCode += ReferenceId.GetHashCode();
            }

            if (Note != null)
            {
                hashCode += Note.GetHashCode();
            }

            if (DeviceOptions != null)
            {
                hashCode += DeviceOptions.GetHashCode();
            }

            if (DeadlineDuration != null)
            {
                hashCode += DeadlineDuration.GetHashCode();
            }

            if (Status != null)
            {
                hashCode += Status.GetHashCode();
            }

            if (CancelReason != null)
            {
                hashCode += CancelReason.GetHashCode();
            }

            if (PaymentIds != null)
            {
                hashCode += PaymentIds.GetHashCode();
            }

            if (CreatedAt != null)
            {
                hashCode += CreatedAt.GetHashCode();
            }

            if (UpdatedAt != null)
            {
                hashCode += UpdatedAt.GetHashCode();
            }

            return(hashCode);
        }