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
Post a Comment