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