How to stop object structure caching

We have a problem testing Entity Framework 4.

We have deployed a WCF service that implements the EF data context. Everything works fine until we change the data using SQL Server Studio.

Is there a way to stop the EF caching of our results or is there a way to activate the download?

Greetings

James

+8
sql-server entity-framework-4
source share
2 answers

In the properties sheet of your model, you can set the Lazy Loading Enabled property.

alt text

Through the code, you can control lazy loading using the ObjectContextOptions.LazyLoadingEnabled property:

 context.ContextOptions.LazyLoadingEnabled = false; 
+7
source share

In EF4, I had to use this instead:

 _context.Configuration.LazyLoadingEnabled = false; 
+4
source share

Source: https://habr.com/ru/post/649794/


All Articles