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

            return
                ((
                     BillingAddress == other.BillingAddress ||
                     BillingAddress != null &&
                     BillingAddress.Equals(other.BillingAddress)
                     ) &&
                 (
                     ContactDetails == other.ContactDetails ||
                     ContactDetails != null &&
                     ContactDetails.Equals(other.ContactDetails)
                 ) &&
                 (
                     FiscalNumber == other.FiscalNumber ||
                     FiscalNumber != null &&
                     FiscalNumber.Equals(other.FiscalNumber)
                 ) &&
                 (
                     Locale == other.Locale ||
                     Locale != null &&
                     Locale.Equals(other.Locale)
                 ) &&
                 (
                     PersonalInformation == other.PersonalInformation ||
                     PersonalInformation != null &&
                     PersonalInformation.Equals(other.PersonalInformation)
                 ) &&
                 (
                     ShippingAddress == other.ShippingAddress ||
                     ShippingAddress != null &&
                     ShippingAddress.Equals(other.ShippingAddress)
                 ));
        }
        /// <summary>
        /// Returns true if CustomerTokenWithContactDetails instances are equal
        /// </summary>
        /// <param name="other">Instance of CustomerTokenWithContactDetails to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CustomerTokenWithContactDetails other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ContactDetails == other.ContactDetails ||
                     ContactDetails != null &&
                     ContactDetails.Equals(other.ContactDetails)
                     ) &&
                 (
                     BillingAddress == other.BillingAddress ||
                     BillingAddress != null &&
                     BillingAddress.Equals(other.BillingAddress)
                 ) &&
                 (
                     PersonalInformation == other.PersonalInformation ||
                     PersonalInformation != null &&
                     PersonalInformation.Equals(other.PersonalInformation)
                 ) &&
                 (
                     CompanyInformation == other.CompanyInformation ||
                     CompanyInformation != null &&
                     CompanyInformation.Equals(other.CompanyInformation)
                 ) &&
                 (
                     MerchantCustomerId == other.MerchantCustomerId ||
                     MerchantCustomerId != null &&
                     MerchantCustomerId.Equals(other.MerchantCustomerId)
                 ) &&
                 (
                     VatNumber == other.VatNumber ||
                     VatNumber != null &&
                     VatNumber.Equals(other.VatNumber)
                 ));
        }
        /// <summary>
        /// Returns true if MandateCustomer instances are equal
        /// </summary>
        /// <param name="other">Instance of MandateCustomer to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(MandateCustomer other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     BankAccountIban == other.BankAccountIban ||
                     BankAccountIban != null &&
                     BankAccountIban.Equals(other.BankAccountIban)
                     ) &&
                 (
                     CompanyName == other.CompanyName ||
                     CompanyName != null &&
                     CompanyName.Equals(other.CompanyName)
                 ) &&
                 (
                     ContactDetails == other.ContactDetails ||
                     ContactDetails != null &&
                     ContactDetails.Equals(other.ContactDetails)
                 ) &&
                 (
                     MandateAddress == other.MandateAddress ||
                     MandateAddress != null &&
                     MandateAddress.Equals(other.MandateAddress)
                 ) &&
                 (
                     PersonalInformation == other.PersonalInformation ||
                     PersonalInformation != null &&
                     PersonalInformation.Equals(other.PersonalInformation)
                 ));
        }