예제 #1
0
        /// <summary>
        /// Returns true if LineItem instances are equal
        /// </summary>
        /// <param name="other">Instance of LineItem to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(LineItem other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AmountOfMoney == other.AmountOfMoney ||
                     AmountOfMoney != null &&
                     AmountOfMoney.Equals(other.AmountOfMoney)
                     ) &&
                 (
                     InvoiceData == other.InvoiceData ||
                     InvoiceData != null &&
                     InvoiceData.Equals(other.InvoiceData)
                 ) &&
                 (
                     Level3InterchangeInformation == other.Level3InterchangeInformation ||
                     Level3InterchangeInformation != null &&
                     Level3InterchangeInformation.Equals(other.Level3InterchangeInformation)
                 ) &&
                 (
                     OrderLineDetails == other.OrderLineDetails ||
                     OrderLineDetails != null &&
                     OrderLineDetails.Equals(other.OrderLineDetails)
                 ));
        }
        /// <summary>
        /// Returns true if OrderReferences instances are equal
        /// </summary>
        /// <param name="other">Instance of OrderReferences to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrderReferences other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Descriptor == other.Descriptor ||
                     Descriptor != null &&
                     Descriptor.Equals(other.Descriptor)
                     ) &&
                 (
                     InvoiceData == other.InvoiceData ||
                     InvoiceData != null &&
                     InvoiceData.Equals(other.InvoiceData)
                 ) &&
                 (
                     MerchantOrderId == other.MerchantOrderId ||
                     MerchantOrderId != null &&
                     MerchantOrderId.Equals(other.MerchantOrderId)
                 ) &&
                 (
                     MerchantReference == other.MerchantReference ||
                     MerchantReference != null &&
                     MerchantReference.Equals(other.MerchantReference)
                 ));
        }