Пример #1
0
 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());
 }
Пример #2
0
 public ActionResult SaveBook(Book book)
 {
     if (book == null)
     {
         return HttpNotFound();
     }
     database.Books.Add(book);
     database.SaveChanges();
     return PartialView("Partial", database.Books.ToList());
 }