public IActionResult NewBook(Book newBook) { BookData.Add(newBook); return(Redirect("/Books")); }
public int Add(Book book) { if (book.MyProperty < 0) { return(0); } bookData.Add(book); return(1); }
public IActionResult OnPost() { if (!ModelState.IsValid) { this.Categories = HtmlHelper.GetEnumSelectList <Category> (); return(Page()); } if (Book.ISN > 0) { BookData.Update(Book); } else { BookData.Add(Book); } BookData.Commit(); TempData["Message"] = "Book Saved"; return(RedirectToPage("./Detail", new { isn = Book.ISN })); }
public int Add(Book model) { return(_bookData.Add(model));; }