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