Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 private void SetCategory(IngredientCategory category)
 => Category = category ?? throw new CoreException(ErrorCode.EmptyModelProperty,
                                                   ErrorMessage.EmptyRecipeIngredientCategory);
Exemplo n.º 3
0
 public static Ingredient Create(string name, IngredientCategory category)
 => new Ingredient(name, category);
Exemplo n.º 4
0
 public void SetCategory(IngredientCategory category)
 => Category = Validate(category, ErrorCode.EmptyModelProperty, ErrorMessage.EmptyIngredientCategory);
Exemplo n.º 5
0
 private Ingredient(string name, IngredientCategory category)
 {
     SetName(name);
     SetCategory(category);
 }