public ActionResult AddRecipe(int recipeId) { List <IngredientWithCountVM> Ingredients = recipeProcessor.GetIngredientsWithCount(recipeId).DTOToViewModelList(MapIngredientWithCount); AddIngredientsToSession(Ingredients); return(RedirectToAction(nameof(Index))); }
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)); }