public IActionResult Create(Library library) { if (ModelState.IsValid) { libraryData.CreateLibrary(library); libraryData.Commit(); TempData["Message"] = "The object is created"; return(RedirectToAction("Index")); } return(View(library)); }
public IActionResult OnPost() { if (ModelState.IsValid) { libraryData.Update(Book); libraryData.Commit(); return(RedirectToPage("./Detail", new { bookId = Book.Id })); } CategoryType = htmlHelper.GetEnumSelectList <Categories>(); return(Page()); }