コード例 #1
0
 public IActionResult Add(AddBookCategoryViewModel addBookCategoryViewModel, string subject)
 {
     if (ModelState.IsValid)
     {
         BookCategory newCategory = new BookCategory
         {
             Subject = subject
         };
         context.BookCategories.Add(newCategory);
         context.SaveChanges();
         return(Redirect("/BookCategory"));
     }
     return(View());
 }
コード例 #2
0
 public IActionResult Add(AddBookCategoryViewModel addBookCategoryViewModel)
 {
     return(View(addBookCategoryViewModel));
 }