private RecipeIngredient(Guid recipeId, Guid ingredientId, string name, IngredientCategory category, string measure, float amount) { RecipeId = recipeId; IngredientId = ingredientId; SetName(name); SetCategory(category); SetMeasure(measure); SetAmount(amount); }
private void SetCategory(IngredientCategory category) => Category = category ?? throw new CoreException(ErrorCode.EmptyModelProperty, ErrorMessage.EmptyRecipeIngredientCategory);
public static Ingredient Create(string name, IngredientCategory category) => new Ingredient(name, category);
public void SetCategory(IngredientCategory category) => Category = Validate(category, ErrorCode.EmptyModelProperty, ErrorMessage.EmptyIngredientCategory);
private Ingredient(string name, IngredientCategory category) { SetName(name); SetCategory(category); }