NCache 4.6 - Online Documentation

Retrieving Keys Associated with a Tag

 
The following example demonstrates how to retrieve keys  from NCache, either related to 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 related to one tags
        ICollection keys = cache.GetKeysByTag(productTags[0]);
 
        //For Finding keys containing at least any one tag from tag list.
        ICollection keys = cache.GetKeysByAnyTag(productTags);
 
        //For finding keys containing all tags from tag list.
        ICollection keys = cache.GetKeysByAllTags(productTags);
 
 
See Also