Below is short example of what I am doing currently – Is there another way to do it efficiently specially if you have big entity with 50 properties and all you want to do it update one value with less lines of code??
[HttpPost]
public ActionResult Person(VMPerson vmperson)
{
Person p = new Person()
p.name = vmperson.name;
p.address = NULL;
TryUpdateModel(p);
db.Person.Save();
}
The most efficient way would be to ditch EF for these types of selected operations. To be honest, if you have an entity with 50 properties I will question your data model and if maybe some of it doesn’t need to be broken up a bit.
That said, update operations are fairly cheap and can be batched. If you are doing mass updates, figure out how to batch them and do that.