Exemplo n.º 1
0
 public IActionResult OnGet(int resturantId)
 {
     Resturant = resturantData.GetById(resturantId);
     if (Resturant == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }
Exemplo n.º 2
0
        public IActionResult Details(int id)
        {
            var model = _resturnatData.GetById(id);

            if (model == null)
            {
                return(RedirectToAction(nameof(Index)));
            }
            return(View(model));
        }
Exemplo n.º 3
0
        public IActionResult OnGet(int id)
        {
            Resturant = _resturantData.GetById(id);
            if (Resturant == null)
            {
                return(RedirectToAction("Index", "Home"));
            }

            return(Page());
        }
 public IActionResult OnGet(int?resturantId)
 {
     Cuisines = htmlHelper.GetEnumSelectList <CuisineType>();
     if (resturantId.HasValue)
     {
         Resturant = resturantData.GetById(resturantId.Value);
     }
     else
     {
         Resturant = new Resturant();
     }
     if (Resturant == null)
     {
         return(RedirectToPage("./NotFound"));
     }
     return(Page());
 }