NCache 4.6 - Online Documentation

Retrieving Key and Values from Cache Containing Tag

 
The following examples demonstrate how to retrieve items (keys and values) from NCache, either containing a specified tag, any tag from the list, or all the tags in the list.
 
      To utilize the API, include the following namespace in your application: Alachisoft.NCache.Web.Caching.
 
        //For finding keys and values related to one tag.
        Hashtable result = cache.GetByTag(productTags[0]);
 
        //For finding keys and values containing at least any one tag in the tag list
        Hashtable result = cache.GetByAnyTag(productTags);
 
        //For finding keys and values related to all tags from the tag list
        Hashtable result = cache.GetByAllTags(productTags);
 
 
See Also