Method GetByTag
GetByTag(Tag)
Gets all the cached objects with the specified tag.
Declaration
[TargetMethod(1)]
public virtual Hashtable GetByTag(Tag tag)
Parameters
Type | Name | Description |
---|---|---|
Tag | tag | The tag to search with. |
Returns
Type | Description |
---|---|
System.Collections.Hashtable | Returns a dictionary containing the cache keys and associated objects. |
Examples
The following example demonstrates how to get the objects with the specified tag.
Cache cache = NCache.InitializeCache("myCache");
Tag tag = new Tag("Sports");
Hashtable table = cache.GetByTag(tag);