Exemplo n.º 1
0
        public ActionResult AddRecipe(int recipeId)
        {
            List <IngredientWithCountVM> Ingredients = recipeProcessor.GetIngredientsWithCount(recipeId).DTOToViewModelList(MapIngredientWithCount);

            AddIngredientsToSession(Ingredients);
            return(RedirectToAction(nameof(Index)));
        }
Exemplo n.º 2
0
        public ActionResult Ingredients(int id, int pageId = 1, string category = null)
        {
            IngredientsPageVM model = new IngredientsPageVM()
            {
                Category = category,
                PageId   = pageId,
                RecipeId = id
            };

            model.Ingredients = recipeProcessor.GetIngredientsWithCount(id).DTOToViewModelList(MapIngredientWithCount);
            return(View(model));
        }