Пример #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (TransactionID != null)
         {
             hashCode = hashCode * 59 + TransactionID.GetHashCode();
         }
         if (BuyerFirstName != null)
         {
             hashCode = hashCode * 59 + BuyerFirstName.GetHashCode();
         }
         if (BuyerLastName != null)
         {
             hashCode = hashCode * 59 + BuyerLastName.GetHashCode();
         }
         if (BuyerAddress != null)
         {
             hashCode = hashCode * 59 + BuyerAddress.GetHashCode();
         }
         if (BuyerCity != null)
         {
             hashCode = hashCode * 59 + BuyerCity.GetHashCode();
         }
         if (BuyerEmail != null)
         {
             hashCode = hashCode * 59 + BuyerEmail.GetHashCode();
         }
         if (BuyerUserId != null)
         {
             hashCode = hashCode * 59 + BuyerUserId.GetHashCode();
         }
         if (PaymentStatus != null)
         {
             hashCode = hashCode * 59 + PaymentStatus.GetHashCode();
         }
         if (PaymentReferenceId != null)
         {
             hashCode = hashCode * 59 + PaymentReferenceId.GetHashCode();
         }
         if (TotalAmount != null)
         {
             hashCode = hashCode * 59 + TotalAmount.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

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

            return(obj is V1Order other &&
                   ((Context == null && other.Context == null) || (Context?.Equals(other.Context) == true)) &&
                   ((Errors == null && other.Errors == null) || (Errors?.Equals(other.Errors) == true)) &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((BuyerEmail == null && other.BuyerEmail == null) || (BuyerEmail?.Equals(other.BuyerEmail) == true)) &&
                   ((RecipientName == null && other.RecipientName == null) || (RecipientName?.Equals(other.RecipientName) == true)) &&
                   ((RecipientPhoneNumber == null && other.RecipientPhoneNumber == null) || (RecipientPhoneNumber?.Equals(other.RecipientPhoneNumber) == true)) &&
                   ((State == null && other.State == null) || (State?.Equals(other.State) == true)) &&
                   ((ShippingAddress == null && other.ShippingAddress == null) || (ShippingAddress?.Equals(other.ShippingAddress) == true)) &&
                   ((SubtotalMoney == null && other.SubtotalMoney == null) || (SubtotalMoney?.Equals(other.SubtotalMoney) == true)) &&
                   ((TotalShippingMoney == null && other.TotalShippingMoney == null) || (TotalShippingMoney?.Equals(other.TotalShippingMoney) == true)) &&
                   ((TotalTaxMoney == null && other.TotalTaxMoney == null) || (TotalTaxMoney?.Equals(other.TotalTaxMoney) == true)) &&
                   ((TotalPriceMoney == null && other.TotalPriceMoney == null) || (TotalPriceMoney?.Equals(other.TotalPriceMoney) == true)) &&
                   ((TotalDiscountMoney == null && other.TotalDiscountMoney == null) || (TotalDiscountMoney?.Equals(other.TotalDiscountMoney) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)) &&
                   ((ExpiresAt == null && other.ExpiresAt == null) || (ExpiresAt?.Equals(other.ExpiresAt) == true)) &&
                   ((PaymentId == null && other.PaymentId == null) || (PaymentId?.Equals(other.PaymentId) == true)) &&
                   ((BuyerNote == null && other.BuyerNote == null) || (BuyerNote?.Equals(other.BuyerNote) == true)) &&
                   ((CompletedNote == null && other.CompletedNote == null) || (CompletedNote?.Equals(other.CompletedNote) == true)) &&
                   ((RefundedNote == null && other.RefundedNote == null) || (RefundedNote?.Equals(other.RefundedNote) == true)) &&
                   ((CanceledNote == null && other.CanceledNote == null) || (CanceledNote?.Equals(other.CanceledNote) == true)) &&
                   ((Tender == null && other.Tender == null) || (Tender?.Equals(other.Tender) == true)) &&
                   ((OrderHistory == null && other.OrderHistory == null) || (OrderHistory?.Equals(other.OrderHistory) == true)) &&
                   ((PromoCode == null && other.PromoCode == null) || (PromoCode?.Equals(other.PromoCode) == true)) &&
                   ((BtcReceiveAddress == null && other.BtcReceiveAddress == null) || (BtcReceiveAddress?.Equals(other.BtcReceiveAddress) == true)) &&
                   ((BtcPriceSatoshi == null && other.BtcPriceSatoshi == null) || (BtcPriceSatoshi?.Equals(other.BtcPriceSatoshi) == true)));
        }
Пример #3
0
        public override int GetHashCode()
        {
            int hashCode = 820864276;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            return(hashCode);
        }
Пример #4
0
        /// <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)
                 ));
        }