Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [AcceptVerbs(HttpVerbs.Post)]
- public ActionResult Edit(Contact contactToEdit) {
- if (!ModelState.IsValid)
- return View();
- try {
- var originalContact = (from c in base._entities.ContactSet
- where c.Id == contactToEdit.Id
- select c).First();
- base._entities.ApplyPropertyChanges(originalContact.EntityKey.EntitySetName, contactToEdit);
- base._entities.SaveChanges();
- return RedirectToAction("Index");
- } catch(Exception e) {
- return View();
- }
- }
- System.Data.Objects.ObjectStateEntry x = base._entities.ObjectStateManager.GetObjectStateEntry(originalContact);
Add Comment
Please, Sign In to add comment