Method GetByTags
GetByTags<T>(IEnumerable<Tag>, TagSearchOptions)
Returns the cached objects that have tags with specified Tag
Declaration
IDictionary<string, T> GetByTags<T>(IEnumerable<Tag> tags, TagSearchOptions type)
Parameters
Type | Name | Description |
---|---|---|
System. |
tags | IEnumerable collection of tags to search cache with. |
Tag |
type | Tag |
Returns
Type | Description |
---|---|
System. |
A dictionary containing cache keys and associated objects with the specified type. |
Type Parameters
Name | Description |
---|---|
T | Specifies the type of value obtained from the cache. |
Examples
The following example demonstrates how to get the objects that have the specified tags
with Tag
ICache cache = CacheManager.GetCache("demoCache");
Tag[] tags = new Tag[2];
tags[0] = new Tag("Alpha");
tags[1] = new Tag("Beta");
IDictionary<string, Product> result = cache.SearchService.GetByTags<Product>(tags,TagSearchOptions.ByAllTags);