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

            if (model == null)
            {
                return(RedirectToAction(nameof(Index)));
            }
            return(View(model));
        }
示例#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());
 }