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