Is there an easy way to use ASP.NET caching with Entity Framework 4.1 Code First? -


we using ef code first app fabric cache on windows azure (although, think question more generic since using asp.net caching provider). there easy way enable caching of dbset objects? our db small , not updated frequently, ideally cache entire database in memory, , use ttl expiry refresh object sets. advise experience caching using ef code first great.

don't that. if want cache data, extract them separate lists , cache them separately. caching dbset means caching dbcontext promote anity-pattern in entity framework. problems identity map , unit of work described in linked answer. problem there no real refresh. if want refresh data must dispose context , create new one. context not thread safe sharing among multiple requests can cause unexpected results.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -