コード例 #1
0
 public IActionResult OnPost()
 {
     if (!ModelState.IsValid)
     {
         return(Page());
     }
     if (Category.CategoryId > 0)
     {
         restaurantData.UpdateCategory(Category);
     }
     else
     {
         restaurantData.AddCategory(Category);
     }
     restaurantData.Commit();
     return(RedirectToPage("./MenuItems", new { categoryId = Category.CategoryId }));
 }