Beispiel #1
0
        public IActionResult OnPost(int bookId)
        {
            var restaurant = bookAction.Delete(bookId);

            bookAction.Commit();

            if (restaurant == null)
            {
                return(RedirectToPage("./NotFound"));
            }

            return(RedirectToPage("./List"));
        }
 public IActionResult OnPost()
 {
     if (!ModelState.IsValid)
     {
         return(NotFound());
     }
     else
     {
         bookAction.Update(Book);
     }
     bookAction.Commit();
     return(RedirectToPage("./List"));
 }
Beispiel #3
0
 public IActionResult OnPost()
 {
     if (!ModelState.IsValid)
     {
         return(NotFound());
     }
     else
     {
         bookAction.Add(Book);
     }
     bookAction.Commit();
     TempData["Message"] = "Restaurant saved!";
     return(RedirectToPage("./List"));
 }