public ActionResult Editar(Fornecedor fornecedor) { _db.Fornecedores.Attach(fornecedor); _db.Entry(fornecedor).State = EntityState.Modified; _db.SaveChanges(); return(RedirectToAction("Index", "Fornecedor")); }
public ActionResult Create([Bind(Include = "EmployeeID,FirstName,LastName,Title,EmailAddress,DepartmentName")] Employee employee) { if (ModelState.IsValid) { db.Employees.Add(employee); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(employee)); }