コード例 #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

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

            return(obj is Order other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((LocationId == null && other.LocationId == null) || (LocationId?.Equals(other.LocationId) == true)) &&
                   ((ReferenceId == null && other.ReferenceId == null) || (ReferenceId?.Equals(other.ReferenceId) == true)) &&
                   ((Source == null && other.Source == null) || (Source?.Equals(other.Source) == true)) &&
                   ((CustomerId == null && other.CustomerId == null) || (CustomerId?.Equals(other.CustomerId) == true)) &&
                   ((LineItems == null && other.LineItems == null) || (LineItems?.Equals(other.LineItems) == true)) &&
                   ((Taxes == null && other.Taxes == null) || (Taxes?.Equals(other.Taxes) == true)) &&
                   ((Discounts == null && other.Discounts == null) || (Discounts?.Equals(other.Discounts) == true)) &&
                   ((ServiceCharges == null && other.ServiceCharges == null) || (ServiceCharges?.Equals(other.ServiceCharges) == true)) &&
                   ((Fulfillments == null && other.Fulfillments == null) || (Fulfillments?.Equals(other.Fulfillments) == true)) &&
                   ((Returns == null && other.Returns == null) || (Returns?.Equals(other.Returns) == true)) &&
                   ((ReturnAmounts == null && other.ReturnAmounts == null) || (ReturnAmounts?.Equals(other.ReturnAmounts) == true)) &&
                   ((NetAmounts == null && other.NetAmounts == null) || (NetAmounts?.Equals(other.NetAmounts) == true)) &&
                   ((RoundingAdjustment == null && other.RoundingAdjustment == null) || (RoundingAdjustment?.Equals(other.RoundingAdjustment) == true)) &&
                   ((Tenders == null && other.Tenders == null) || (Tenders?.Equals(other.Tenders) == true)) &&
                   ((Refunds == null && other.Refunds == null) || (Refunds?.Equals(other.Refunds) == true)) &&
                   ((Metadata == null && other.Metadata == null) || (Metadata?.Equals(other.Metadata) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)) &&
                   ((ClosedAt == null && other.ClosedAt == null) || (ClosedAt?.Equals(other.ClosedAt) == true)) &&
                   ((State == null && other.State == null) || (State?.Equals(other.State) == true)) &&
                   ((Version == null && other.Version == null) || (Version?.Equals(other.Version) == true)) &&
                   ((TotalMoney == null && other.TotalMoney == null) || (TotalMoney?.Equals(other.TotalMoney) == true)) &&
                   ((TotalTaxMoney == null && other.TotalTaxMoney == null) || (TotalTaxMoney?.Equals(other.TotalTaxMoney) == true)) &&
                   ((TotalDiscountMoney == null && other.TotalDiscountMoney == null) || (TotalDiscountMoney?.Equals(other.TotalDiscountMoney) == true)) &&
                   ((TotalTipMoney == null && other.TotalTipMoney == null) || (TotalTipMoney?.Equals(other.TotalTipMoney) == true)) &&
                   ((TotalServiceChargeMoney == null && other.TotalServiceChargeMoney == null) || (TotalServiceChargeMoney?.Equals(other.TotalServiceChargeMoney) == true)) &&
                   ((PricingOptions == null && other.PricingOptions == null) || (PricingOptions?.Equals(other.PricingOptions) == true)) &&
                   ((Rewards == null && other.Rewards == null) || (Rewards?.Equals(other.Rewards) == true)));
        }
コード例 #2
0
 public override void Validate(Validations validationType = Validations.Weak)
 {
     base.Validate(validationType);
     InputValidators.ValidateObjectNotNull(Fulfillments, "Fulfillments");
     Fulfillments.ToList().ForEach(item => item.Validate(validationType));
 }
コード例 #3
0
        public override int GetHashCode()
        {
            int hashCode = 401631729;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            return(hashCode);
        }