In my application I use MemoryCache and I wanted to add a functionality to it. When I read a value from the cache I want to check against its expiration date and if it's soon, I want to run a refresh (which takes long) for this key in the background.
To achieve this I need to get ICacheEntry which has the info about the expiration date, but there is no way to access it through IMemoryCache interface which I use. So I decided to derive from it and add a method to get ICacheEntry. The problem is that EntriesCollection in MemoryCache is private instead of protected.
Is there any other way to get cache entry (not just value of cached entry) using this library? Or should I use some other library to achieve what I need?