In ASP.NET, we always store an object or a collection into cache, this is, when we want to use them, we can judge if the object or the collection has already exist in cache, if exist, we retrieve it from cache, if not, retrieve it from database. Does EF has the similar mechanism, after calling “context.ObjectSet.AddObject(object)” or calling method to attach an object to the context, save it to the cache, and when we want to retrieve the object, judge whether the object has already exist in cache first. Anybody can help?
Share
You must query
ObjectStateManagerto find if it already contains your entity: