How can i discover that object is attached to specific Object Context?
if i have 2 objectContexts for the same model each one hold some objects..
开发者_开发问答How can i find that object is attached to specific Object Context?
I have one solution by check the object With ObjectStateManager like this :
bool isPresent = objectStateManager.TryGetObjectStateEntry(((IEntityWithKey)order).EntityKey, out stateEntry);
if (isPresent)
{
Console.WriteLine("The entity was found");
}
is this will work always fine?
精彩评论