public ActionResult IngredientDetails(int ingredientId, int recipeId) { var ingredientDetailsViewModel = new IngredientDetailsNewViewModel { Ingredient = _ingredientService.GetIngredientById(ingredientId), RecipeId = recipeId }; return(View(ingredientDetailsViewModel)); }
public ActionResult IngredientDetails(IngredientDetailsNewViewModel model) { if (!ModelState.IsValid) { return(View(model)); } var ingredientToCreate = _ingredientService.EditIngredient(model.Ingredient); return(RedirectToRoute("EditRecipeIngredient", new { recipeId = model.RecipeId })); }