コード例 #1
0
 public IActionResult OnGet(int restaurantId)
 {
     Restaurant = restaurantData.GetRestaurantsById(restaurantId);
     if (Restaurant != null)
     {
         return(Page());
     }
     else
     {
         return(RedirectToPage("./notfound"));
     }
 }
コード例 #2
0
ファイル: edit.cshtml.cs プロジェクト: manjusaharan/CoreApp
        public IActionResult OnGet(int?restaurantId)
        {
            Cuisines = htmlHelper.GetEnumSelectList <CuisineType>();

            if (restaurantId.HasValue)
            {
                Restaurant = restaurantData.GetRestaurantsById(restaurantId.Value);
            }
            else
            {
                Restaurant = new Restaurant();
            }
            if (Restaurant == null)
            {
                return(RedirectToPage("./notfound"));
            }
            else
            {
                return(Page());
            }
        }