Does Entity Framework have a caching mechanism like DataSet / DataTables?
Does Entity Framework have a caching mechanism like DataSet / DataTables?
In other words, if you start using EF, this is really just a way to easily get data to / from the database without providing an extra layer of caching like DataSet / DataTables where you have an in-memory view (online / off-line). and at some point you can say "save all changes to the database"
a source to share
Depends on how complex the cache you are linking to is.
EF has an object cache. Cm...
Name resolution, state management, and change tracking
ObjectContext is a container for objects in memory. The object context, using other classes and interfaces, manages the identifier, state, initial and current values โโof the object's properties, and keeps track of the changes made to each object in the cache.
and...
Save Changes and Manage Concurrency
These articles have added some EF object cache.
For further caching, you can write a wrapper like in ... http://blogs.msdn.com/efdesign/archive/2008/07/09/transparent-caching-support-in-the-entity-framework.aspx
a source to share
You can check out this entity framework caching provider . It contains 3 implementations of the ICache interface that you can use in your applications:
- AspNetCache is a cache that uses the ASP.NET Caching Engine.
- InMemoryCache is a simple, built-in LRU policy base expiration cache.
- VelocityCache is a caching implementation that uses the Microsoft Distributed Cache Codename "Velocity" CTP3.
a source to share