Exemplo n.º 1
0
        public IActionResult OnGet(int restaurantId)
        {
            Restaurant = _restaurantData.GetByIdRestaurant(restaurantId);

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

            return(Page());
        }
Exemplo n.º 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());
        }