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); }