public OrderProduct(Product product, int count) { Product = product; Count = count; AmountValue = Product.AmountValue; Product.UpdateStoreCountTo(Math.Abs(Count)); }
public OrderProduct(Product product, int count, decimal amountValue) { Product = product; Count = count; Product.UpdateStoreCountTo(Math.Abs(Count)); if (amountValue <= 0) { throw new ArgumentException($"{nameof(amountValue)} cannot be zero or negative.", nameof(amountValue)); } AmountValue = amountValue; }