Exemplo n.º 1
0
        public async Task EditIngredient(EditIngredientRequestModel editIngredient)
        {
            var ingredientToUpdate = await _ingredientRepository.Get(editIngredient.Id);

            if (ingredientToUpdate != null)
            {
                ingredientToUpdate.MeasurmentId = editIngredient.MeasurmentId;
                ingredientToUpdate.Title        = editIngredient.Title;
                await _ingredientRepository.Edit(ingredientToUpdate);
            }
        }
        public IActionResult Edit(MealIngredientViewModel model)
        {
            var ingredient = new Ingredient();

            ingredient.ItemId  = model.ItemId;
            ingredient.Measure = model.Measure;
            //ingredient.Unit = model.Unit;

            _ingredientRepository.Edit(ingredient);
            return(RedirectToAction("Index", "MealIngredient", new { id = model.MealId }));
        }
 public void Edit(Ingredient entity)
 {
     _ingrerdientRepository.Edit(entity);
 }