Asdfg
Asdfg

Reputation: 12253

how do i disable Caching in Entity Framework from Config file

I am running into some problems where huge objects occupy memory and the reference is not being released. I used .Net Memory Profiler to find out the root object and it references to Entity Framework class.

Is there a way i can disable the caching of queried objects in Entity framework without chanign the code? Something in the config file may be?

Upvotes: 2

Views: 6896

Answers (1)

Jethro
Jethro

Reputation: 5916

You should have using statements to help dispose you ObjectContext. EF keeps an object graph of the queried objects. I think you could use objectContext.Detach(Entity); to detach your entities from the ObjectContext.

Upvotes: 3

Related Questions