Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting all keys from NCache Server [closed]

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 ?

like image 874
Rıfat Erdem Sahin Avatar asked Oct 26 '25 08:10

Rıfat Erdem Sahin


2 Answers

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....

like image 57
Muhammad Basit Avatar answered Oct 28 '25 22:10

Muhammad Basit


Try LINQ they have an example on the website:

http://www.alachisoft.com/resources/docs/ncache/38sp3/Online-Help/Developing-with-NCache/NETProgrammerGuide/ClientSideAPI-Programming/Queries&LINQ/LINQ/NCache-LINQ.htm

like image 34
WFB Avatar answered Oct 28 '25 21:10

WFB