Entity framework 4, update specific properties

I use the code first where I can:

db.Users.Attach(user); db.Entry(user).Property(propertyName).IsModified = true; 

How to do this using the DataModel method?

I don't have an Entry method in my datacontext.

0
source share
1 answer

Using:

 context.Users.Attach(user); ObjectStateEntry entry = context.ObjectStateManager.GetObjectStateEntry(user); entry.SetModifiedProperty(propertyName); 
0
source

Source: https://habr.com/ru/post/1388871/


All Articles