Skip to content

ChrisNanda/EntityFramework.Cache

Repository files navigation

EntityFramework.Cache is a caching mechanism for EntityFramework 4.1 and above. 

The initial project was created by Sergey Barskiy and posted here:http://dotnetspeak.com/index.php/2011/03/entity-framework-code-first-caching/

Initial issue with this was the Expressions were not evaluated to get a variables value, so

var isActive = true;
var query = context.Products
.OrderBy(one => one.ProductNumber)
.Where(one => one.IsActive == isActive).AsCacheable();

and 
var isActive = false;
var query = context.Products
.OrderBy(one => one.ProductNumber)
.Where(one => one.IsActive == isActive).AsCacheable();

Would evaluate the same.

HOCA posted a fix on StackOverflow to remedy this, but as of yet performance of this has not been tested.  The post is here: http://stackoverflow.com/questions/8275881/generating-cache-keys-from-iqueryable-for-caching-results-of-ef-code-first-queri

About

Entity Framework Code First Caching Mechanism

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages