public IActionResult Edit(int recipeId, string name, string dyeColor) { MXRecipe recipeById = RecipeData.GetById(recipeId); recipeById.Name = name; recipeById.DyeColor = dyeColor; return(Redirect("/Recipe")); }
public IActionResult Edit(int recipeId) { MXRecipe recipeById = RecipeData.GetById(recipeId); ViewBag.editRecipe = recipeById; ViewBag.title = $"Edit Event {recipeById.Name} (id={recipeById.Id})"; return(View()); }
public IActionResult Calculator(CalculateMXRecipeViewModel calculateMXRecipeViewModel) { MXRecipe newMXRecipe = new MXRecipe { Name = calculateMXRecipeViewModel.Name, DyeColor = calculateMXRecipeViewModel.DyeColor }; RecipeData.Add(newMXRecipe); return(Redirect("/Recipe")); }
// Add public static void Add(MXRecipe newMXRecipe) { MXRecipes.Add(newMXRecipe.Id, newMXRecipe); }