entity framework mark as modified code first 5 -
marking property modified should done this:
using (var context = new unicornscontext()) { var unicorn = context.unicorns.find(1); var nameismodified1 = context.entry(unicorn).property(u => u.name).ismodified; // use string property name var nameismodified2 = context.entry(unicorn).property("name").ismodified; }
code sample here
in code unicornscontext extends dbcontext
.
i don't have entry
method context. whats's wrong?
Comments
Post a Comment