c# - Detect changes in ObjectSet in Entity Framework 4.0? -
i want check if there changes in table in ef 4.0 following code:
var = context.users.gethashcode(); addnewuser(); context.savechanges(); var b = context.users.gethashcode();
a == b, don't know why?
any helps appreciated!
gethashcode
has absolutelly different usage. can't detect changes in objectset
because entry point related database table(s). can detect changes prepared in objectcontext
before accept changes (default savechanges
accept changes). changes objectcontext
use:
context.objectstatemanager.getobjectstateentries(...)
Comments
Post a Comment