NCache 4.6 - Online Documentation

Retrieving Keys and Values Pertaining to a Particular Group

 
To return the dictionary of keys and values that belong to a specified group and sub-group, the GetGroupData method in NCache can be used. This method returns a dictionary of keys and values.
 
      To utilize the following APIs, include the following namespace in your application: Alachisoft.NCache.Web.Caching.
 
        try
        {
            IDictionary data = cache.GetGroupData("Product", "Beverages") as IDictionary;
 
            if (data.Count > 0)
            {
                IDictionaryEnumerator result = data.GetEnumerator();
 
                while (result.MoveNext())
                {
                    string key = (string)result.Key;
 
                    Product val = (Product)result.Value;
                    //do something
                }
            }
        }
        catch (Exception ex)
        {
            // handle exception
        }
 
 
See Also