4

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?

2
  • here is one Commented 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. Commented Nov 19, 2011 at 23:03

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.