KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I need to update all fields except property1 and property2 for the given entity object. Having this code: [HttpPost] public ActionResult Add(object obj) { if (ModelState.IsValid) { context.Entry(obj).State = System.Data.EntityState.Modified; context.SaveChanges(); } return View(obj); } How to change it to add an exception to obj.property1 and obj.property2 for not being updated with this code?
Tags (comma-separated)
Save Edits
Cancel