0

This is regarding MS Enterprise Application Block cache.

Is there a way to see what is inside cache in terms of keys? I am trying to find out if there is a way to query into cache object and find out which keys are stored in there. Then, once I have the keys, I could query the keys and see what is stored in them. Please let me know if this is possible.

1 Answer 1

1

You need to create your own BackingStore, implementing from IBackingStore. You then can do anything you want in there, for example, maintain a List with all the Keys with each Add/Remove issues to your own BackingStore. Example as follows:

public class MyBackingStore : IBackingStore
{
    public List<string> keys = new List<string>();

    public void Add(CacheItem newCacheItem)
    {
        keys.Add(newCacheItem.Key);
    }

    public void Remove(string key)
    {
        keys.Remove(key);
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.