4

We are thinking about to use NCache from alachisoft.

Does it have a method to get all keys and values ?

We are trying to understand how we can do it?

Redis has this kind of feature, does Ncache miss this feature ?

Rıfat Erdem Sahin
  • 1,738
  • 4
  • 29
  • 47

2 Answers2

5

Does it have a method to get all keys and values? The answer is YESSS!

There are two ways to do it.

  1. NCache has a method GetEnumerator() which traverse through all keys present in cache.

  2. NCache's Cache class is a key-value pair object, so you can loop through all keys using foreach loop like;

    foreach (string key in _cache) // _cache is an object of 'Cache' class.
    {
        object value = _cache.Get(key);
        // do whatever you want do further.....
    }
    

Regards....

sumgeek
  • 76
  • 1
  • 13
Muhammad Basit
  • 89
  • 1
  • 2
  • 6