Пример #1
0
 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));
 }
Пример #2
0
        public IActionResult OnPost()
        {
            if (ModelState.IsValid)
            {
                libraryData.Update(Book);
                libraryData.Commit();
                return(RedirectToPage("./Detail", new { bookId = Book.Id }));
            }

            CategoryType = htmlHelper.GetEnumSelectList <Categories>();
            return(Page());
        }