public IActionResult AddIngredientToSession(int ingredientID) { if (_dishService.IngredientExists(ingredientID) == true) { ViewBag.IngredientError = "Ingrediensen finns redan i maträtten"; } else { _dishService.AddIngredientToSession(ingredientID); } var model = new CreateDishViewModel { DishIngredients = _dishService.FetchIngredientsFromSession(), Ingredients = _dishService.FetchDishIngredients(), Categories = _dishService.FetchDishCategories() }; return(ViewComponent("CreateDishIngredients", model)); }