Property Tags
Tags
Using Tags, you can associate keywords(s) with your cache items. You can mark your data with tags, which act as identifiers for your cache items. Using this property, you can easily set tags for a cache item.
Declaration
public Tag[] Tags { get; set; }
Property Value
Type | Description |
---|---|
Tag[] | This property associates keywords with your cache items so that they are logically grouped together and can be retrieved efficiently. |
Examples
The following example sets multiple Tag of a CacheItem.
Product product = new Product();
product.Id = 1;
product.Name = "Chai";
CacheItem item = new CacheItem(product);
Tag[] tags = new Tag[2];
tags[0] = new Tag("alpha");
tags[1] = new Tag("beta");
item.Tags = tags;