public ActionResult Details(int id) { var model = resturantData.Get(id); if (model == null) { return(View("NotFound")); } return(View(model)); }
public IActionResult Edit(int id) { var resturant = _resturantData.Get(id); if (resturant == null) { return(RedirectToAction("Index")); } var model = new ResturantViewModel { Name = resturant.Name, Cuisine = resturant.Cuisine }; return(View(model)); }
public IActionResult OnGet(int id) { Restaurant = _restaurantData.Get(id); if (Restaurant == null) { return(RedirectToAction("Index", "Home")); } return(Page()); }
public IActionResult Details(int id) { var model = _resturantData.Get(id); if (model == null) { return(RedirectToAction(nameof(Index))); } return(View(model)); }