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