Example #1
0
        public IActionResult OnGet(int restaurantId)
        {
            Restaurant = _restaurantData.GetByIdRestaurant(restaurantId);

            if (Restaurant is null)
            {
                return(RedirectToPage("./NotFound"));
            }

            return(Page());
        }
Example #2
0
        public IActionResult OnGet(int?restaurantId)
        {
            Cusines = _helper.GetEnumSelectList <CuisineType>();
            if (restaurantId.HasValue)
            {
                Restaurant = _restaurantData.GetByIdRestaurant(restaurantId.Value);
                if (Restaurant is null)
                {
                    RedirectToPage("./NotFound");
                }
            }
            else
            {
                Restaurant = new Restaurant();
            }


            return(Page());
        }