private Ingredient(IngredientId id, string name, WholesalerId wholesalerId, decimal price, PurchaseAmount purchaseAmount) { this._id = id ?? throw new ArgumentNullException(nameof(id)); this._name = name ?? throw new ArgumentNullException(nameof(name)); this._wholesalerId = wholesalerId ?? throw new ArgumentNullException(nameof(wholesalerId)); this._purchaseAmount = purchaseAmount ?? throw new ArgumentNullException(nameof(purchaseAmount)); this._monthlyProperyYearlySet = new YearlySet <IngredientMonthlyProperty>(); }
public static Ingredient UseNewIngredient(string name, WholesalerId wholesalerId, decimal price, PurchaseAmount purchaseAmount) { return(new Ingredient(IngredientIdRepository.NextIdentifier(), name, wholesalerId, price, purchaseAmount)); }