public QuantityUpdate(WooCommerceProduct product, Dictionary <string, int> skusQuantities) { this.IsUpdateNeeded = false; if (product.Id == null || string.IsNullOrWhiteSpace(product.Sku) || product.ManagingStock == null || product.ManagingStock != true) { return; } var quantityUpdate = skusQuantities.FirstOrDefault(s => s.Key.ToLower() == product.Sku.ToLower()); var skuFound = !string.IsNullOrWhiteSpace(quantityUpdate.Key); if (skuFound && (product.Quantity.HasValue ? quantityUpdate.Value != product.Quantity : quantityUpdate.Value >= 0)) { IsUpdateNeeded = true; Id = product.Id.Value; Sku = product.Sku; Quantity = quantityUpdate.Value; } }