public IActionResult Detail(int id) { Recipe recipe = recipeDAO.GetRecipeById(id); if (recipe == null) { return(NotFound()); } return(View(recipe)); }
public ActionResult <Recipe> GetRecipeById(int id) { Recipe recipe = dao.GetRecipeById(id); if (recipe == null) { return(NotFound()); } return(Ok(recipe)); }
/// <summary> /// Shows detail for a single recipe /// </summary> /// <param name="id">Id of the recipe to show</param> /// <returns></returns> public IActionResult Detail(int id) { // Use the DAO to get the recipe Recipe recipe = recipeDAO.GetRecipeById(id); if (recipe == null) { // Recipe not found - 404 return(NotFound()); } // Recipe was found. Invode the Detail view to show it. return(View(recipe)); }
public ActionResult <Recipe> GetOneRecipe(int id) { Recipe recipe = recipeDAO.GetRecipeById(id); if (recipe == null) { return(NotFound()); } return(recipe); }
public IActionResult Detail(int id) { Recipe recipe = recipeDAO.GetRecipeById(id); return(View(recipe)); }