I'm having a bit of trouble getting my head around when entities are attached and change tracked and when they are not. Sorry if this has already been asked. Say I have some code like this:
public MyEntity GetEntity()
{
using (var ctx = new MyObjectContext)
{
return ctx.MyEntitySet.First();
}
}
Then I call it
var result = GetEntity();
Should result be attached or detached from the context?
I was under the impression that when the ObjectContext got disposed the entity lost its change tracking. Or is the Context never getting disposed.