Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ycaroafonso/7995325 to your computer and use it in GitHub Desktop.
Save ycaroafonso/7995325 to your computer and use it in GitHub Desktop.
[HttpPost]
public ActionResult Edit(Pessoa pessoa)
{
if (ModelState.IsValid)
{
db.PessoaSet.Attach(pessoa);
System.Data.Objects.ObjectStateEntry entry = db.ObjectStateManager.GetObjectStateEntry(pessoa);
entry.SetModifiedProperty("Nome");
entry.SetModifiedProperty("DataNascimento");
db.SaveChanges();
return RedirectToAction("Index");
}
return View(pessoa);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment