How can I get rid of the object context?

entity-framework

Question

How do I remove the context if I have run many queries and my ObjectContext contains entities that I no longer require? I am aware that I must get rid of the context as quickly as possible, but it is not feasible in this situation. Is there a method for me to take those items out of the context, then?

1
4
9/29/2010 11:06:58 PM

Accepted Answer

Each entity in the context may be attempted to be Detached.

1
9/30/2010 12:03:21 PM

Popular Answer

The ObjectContext cannot be "cleared" using any method. The only method to do that is to start a new instance of ObjectContext after disposing of the present one.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow