public ActionResult Edit(Editora editora) { if (ModelState.IsValid) { editora.ConfigurarParaSalvar(); db.Entry(editora).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(editora)); }
public ActionResult Create(Editora editora) { if (ModelState.IsValid) { editora.ConfigurarParaSalvar(); db.Fornecedor.Add(editora); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(editora)); }