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