Ejemplo n.º 1
0
        public ActionResult Delete(Guid id)
        {
            int recipesCount = this.manager.GetRecipesCount(id);
            var ingredient   = this.manager.Find(id);
            var model        = new IngredientDeleteViewModel
            {
                Name         = ingredient.Name,
                RecipesCount = recipesCount
            };

            return(View(model));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Delete(IngredientDeleteViewModel viewModel)
        {
            await this.ingredientsService.DeleteAsync(viewModel.Id);

            return(this.RedirectToAction(nameof(Web.Controllers.IngredientsController.All), new { area = string.Empty }));
        }