I have been using entlib caching application block on a windows client. Entlib caching has become a legacy app since the inclusion of caching in runtime. I am trying to migrate my code because it seems the right thing to do, but also because unlike
Entlib, the runtime version allows me the opportunity to update cache items before they are evicted from the cache. Unfortunately I can't make it work.
I am using MemoryCache.
1. MemoryCache.Add throws when policy includes an update callback. It says UpdateCallback must be null. Must be a bug. MemoryCache.Set works.
2. SlidingExpiration does not slide - it is absolute.
3. As I read the docs, the update callback method can replace the item to be removed by setting the UpdatedCacheItem property, but it doesn't
4. The fact there is no documentation does not help and is inexcusable.
Am I looking at this in completely the wrong way?
Here is a test rig:
View Complete Post