c# - Using statment and Entity Framework Entities -
When there are entities linked to my head then I'm having trouble and tracked changes and when they are not I'm sorry if this is already asked. Say I have a code like this:
Public MyNetty Getty () {(var ctx = New MyObjectContext) {return ctx.MyEntitySet.First (); }}
Then I call it
var result = GetEntity ();
Should the context be linked or different?
I was under the impression that when the objectcontact was settled, the unit changed, or the context is never being settled.
If you type that code while ctx
has been settled , Because you have not separated the unit from ctx
, you can not attach it to any other reference, basically it remains from a backpointer unit to ctx
, which is happening Prevents from
I think you can say that this is 'psuedo-enclosed'.
Hope this helps
Program Manager Entity Framework Team
Comments
Post a Comment