public ActionResult Edit(BooksDB bookdb) { if (ModelState.IsValid) { db.Entry(bookdb).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(bookdb); }
public ActionResult Create(BooksDB bookdb) { if (ModelState.IsValid) { db.Books.Add(bookdb); db.SaveChanges(); return RedirectToAction("Index"); } return View(bookdb); }