Beispiel #1
0
 public int GetIdempotentKey()
 {
     unchecked
     {
         int hashCode = Currency?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ DiscountAmount.GetHashCode();
         hashCode = (hashCode * 397) ^ Items.GetIdempotentListKey();
         hashCode = (hashCode * 397) ^ TotalGrossAmount.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalNetAmount.GetHashCode();
         return(hashCode);
     }
 }
 /// <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 (DiscountAmount != null)
         {
             hashCode = hashCode * 59 + DiscountAmount.GetHashCode();
         }
         if (GoogleProductCategoryId != null)
         {
             hashCode = hashCode * 59 + GoogleProductCategoryId.GetHashCode();
         }
         if (LineAmountTotal != null)
         {
             hashCode = hashCode * 59 + LineAmountTotal.GetHashCode();
         }
         if (ProductCategory != null)
         {
             hashCode = hashCode * 59 + ProductCategory.GetHashCode();
         }
         if (ProductCode != null)
         {
             hashCode = hashCode * 59 + ProductCode.GetHashCode();
         }
         if (ProductName != null)
         {
             hashCode = hashCode * 59 + ProductName.GetHashCode();
         }
         if (ProductPrice != null)
         {
             hashCode = hashCode * 59 + ProductPrice.GetHashCode();
         }
         if (ProductType != null)
         {
             hashCode = hashCode * 59 + ProductType.GetHashCode();
         }
         if (Quantity != null)
         {
             hashCode = hashCode * 59 + Quantity.GetHashCode();
         }
         if (TaxAmount != null)
         {
             hashCode = hashCode * 59 + TaxAmount.GetHashCode();
         }
         if (Unit != null)
         {
             hashCode = hashCode * 59 + Unit.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #3
0
        public override int GetHashCode()
        {
            var hashCode = -536786706;

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(discountCode);

            hashCode = hashCode * -1521134295 + discountType.GetHashCode();
            hashCode = hashCode * -1521134295 + startDate.GetHashCode();
            hashCode = hashCode * -1521134295 + EndDate.GetHashCode();
            hashCode = hashCode * -1521134295 + DiscountAmount.GetHashCode();
            hashCode = hashCode * -1521134295 + Percentages.GetHashCode();
            return(hashCode);
        }
Beispiel #4
0
 public int GetIdempotentKey()
 {
     unchecked
     {
         int hashCode = Currency?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ DiscountAmount.GetHashCode();
         hashCode = (hashCode * 397) ^ (ImageUrl?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ LineItems.GetIdempotentListKey();
         hashCode = (hashCode * 397) ^ (MerchantImageUrl?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Number?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ TotalGrossAmount.GetHashCode();
         hashCode = (hashCode * 397) ^ TotalNetAmount.GetHashCode();
         return(hashCode);
     }
 }
 public int GetIdempotentKey()
 {
     unchecked
     {
         int hashCode = Description?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ DiscountAmount.GetHashCode();
         hashCode = (hashCode * 397) ^ GrossUnitPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ LineNumber;
         hashCode = (hashCode * 397) ^ NetUnitPrice.GetHashCode();
         hashCode = (hashCode * 397) ^ (ProductId?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ Quantity.GetHashCode();
         hashCode = (hashCode * 397) ^ VatAmount.GetHashCode();
         hashCode = (hashCode * 397) ^ VatPercent.GetHashCode();
         return(hashCode);
     }
 }
Beispiel #6
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = CollectionId.GetHashCode();
         hashCode = (hashCode * 397) ^ CreatedAt.GetHashCode();
         hashCode = (hashCode * 397) ^ DiscountAmount.GetHashCode();
         hashCode = (hashCode * 397) ^ (DiscountType != null ? DiscountType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Id.GetHashCode();
         hashCode = (hashCode * 397) ^ (Images != null ? Images.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ ProductId.GetHashCode();
         hashCode = (hashCode * 397) ^ ShopifyProductId.GetHashCode();
         hashCode = (hashCode * 397) ^ (SubscriptionDefaults != null ? SubscriptionDefaults.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Title != null ? Title.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ UpdatedAt.GetHashCode();
         return(hashCode);
     }
 }
Beispiel #7
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 (DiscountAmount != null)
         {
             hashCode = hashCode * 59 + DiscountAmount.GetHashCode();
         }
         if (DutyAmount != null)
         {
             hashCode = hashCode * 59 + DutyAmount.GetHashCode();
         }
         if (ShippingAmount != null)
         {
             hashCode = hashCode * 59 + ShippingAmount.GetHashCode();
         }
         return(hashCode);
     }
 }