Second level Cache for Entity Framework 6.1
Entity Framework does not currently support caching of query results. A Sample EF Caching provider is available for Entity Framework version 5 and earlier but due to changes to the provider mo Del This is a sample provider does not work with Entity Framework 6 and newer. This are filling the gap by enabling caching of query results for Entity Framework 6.1 applications. https://efcache.codeplex.com/
How to get it
You can get it from Nuget-just install the Entityframework.cache NuGet package
How to use it
The project uses a combination of a wrapping provider and a transaction interceptor. A simple Inmemorycache are included in the project. To use the IT you need first configure EF using code based configuration. Here's an example of about such a configuration looks like.
public class configuration:dbconfiguration{public Configuration () { var transactionhandler = new Cachetransactionhandler (New Inmemorycache ()); Addinterceptor (Transactionhandler); var cachingpolicy = new Cachingpolicy (); Loaded + = (sender, args) = args. Replaceservice<dbproviderservices> ( s, _) = new Cachingproviderservices (s, Transactionhandler, Cachingpolicy));} }
Before use:
Install the package:
After use:
Second level Cache for Entity Framework 6.1