public ActionResult Create(Reader reader) { if (ModelState.IsValid) { try { db.Reader.Add(reader); db.SaveChanges(); } catch { } return RedirectToAction("Index"); } return View(reader); }
public ActionResult Edit(Reader reader) { if (ModelState.IsValid) { //try //{ db.Entry(reader).State = EntityState.Modified; db.SaveChanges(); //} //catch { } return RedirectToAction("Index"); } return View(reader); }