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()); }
public IActionResult Add(AddBookCategoryViewModel addBookCategoryViewModel) { return(View(addBookCategoryViewModel)); }