예제 #1
0
        public void Edit(EditRecipeViewModel editModel)
        {
            var recipe = recipes.FirstOrDefault(r => r.Id == editModel.Id);

            recipe.Name = editModel.Name;
            recipe.NameOfPlate = editModel.NameOfPlate;
            recipe.Ingredients = editModel.Ingredients;
            recipe.HowToDo = editModel.HowToDo;
        }
예제 #2
0
        public void Edit(EditRecipeViewModel editModel)
        {
            var recipe = _context.Recipes.FirstOrDefault(r => r.Id == editModel.Id);

            recipe.Name = editModel.Name;
            recipe.NameOfPlate = editModel.NameOfPlate;
            recipe.Ingredients = editModel.Ingredients;
            recipe.HowToDo = editModel.HowToDo;

            _context.SaveChanges();
        }
예제 #3
0
 public IActionResult Edit(EditRecipeViewModel recipeModel)
 {
     _repository.Edit(recipeModel);
     return RedirectToAction("Published");
 }