public ActionResult Details(int id)
        {
            var model = resturantData.Get(id);

            if (model == null)
            {
                return(View("NotFound"));
            }
            return(View(model));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
 public IActionResult OnGet(int id)
 {
     Restaurant = _restaurantData.Get(id);
     if (Restaurant == null)
     {
         return(RedirectToAction("Index", "Home"));
     }
     return(Page());
 }
Exemple #4
0
        public IActionResult Details(int id)
        {
            var model = _resturantData.Get(id);

            if (model == null)
            {
                return(RedirectToAction(nameof(Index)));
            }
            return(View(model));
        }