How to stop entity framework caching
We're having a problem testing Entity Framework 4.
We've deployed a WCF service that implements an EF data context. All works fine untill we modify the data using SQL server studio.
Is there a way to stop EF caching our results or is there any way to turn eager loading on?
On the property sheet for your model, you can set the Lazy Loading Enabled property.
Through code, you can control lazy loading with the ObjectContextOptions.LazyLoadingEnabled property:
context.ContextOptions.LazyLoadingEnabled = false;