It is possible to use the Entity framework caching and tracing framework with the new entity framework 4.1 code first? If so then is there a good example of this, otherwise what is the best way to cache some queries?
-
here is onenp-hard– np-hard2011-11-15 20:09:41 +00:00Commented Nov 15, 2011 at 20:09
-
Good question, I'm curious at your outcome. I have limited caching in my MVC3 web app in which I used EF 4.1. I implemented caching at the website layer for dropdowns and common psuedo-static lookup sets. I use built-in ASP.NET Cache to cache collections returned from calls to my service layer (which may soon be on it's own physical tier). Works well for me but is obviously a very simple scenario.kingdango– kingdango2011-11-19 23:03:09 +00:00Commented Nov 19, 2011 at 23:03
Add a comment
|
1 Answer
Here is an example of a caching system for EntityFramework (with EDMX) http://code.msdn.microsoft.com/EFProviderWrappers-c0b88f32
Here is how you use that example with CodeFirst http://jkowalski.com/2010/04/23/logging-sql-statements-in-entity-frameworkcode-first/
Although he is demoing the tracing provider rather than the caching provider you can use the same principals