I'm wondering why there is no Detach method on the DbContext object like there is for ObjectContext. ?I can only assume this omission was intentional, but I have a hard time figuring out why. ?I need to be able to detach and re-attach entities (for putting in the cache in an ASP.NET project, for example). ?However, since I can't detach an entity, when I try to attach an entity that was associated with a previous context, I get the "An entity object cannot be referenced by multiple instances of IEntityChangeTracker" exception.
What's the guidance here? ?Am I missing something?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…