public ActionResult EditBook(Book book) { if (book == null || !database.Books.Contains(book)) { return HttpNotFound(); } database.Entry(book).State = EntityState.Modified; database.SaveChanges(); return PartialView("Partial", database.Books.ToList()); }
public ActionResult SaveBook(Book book) { if (book == null) { return HttpNotFound(); } database.Books.Add(book); database.SaveChanges(); return PartialView("Partial", database.Books.ToList()); }