Method GetValue
GetValue<T>()
Returns the value stored in the CacheItem.
Declaration
public T GetValue<T>()
Returns
Type | Description |
---|---|
T | Value of the cache item with the type defined. |
Type Parameters
Name | Description |
---|---|
T | Specifies the type of value obtained from the cache item. |
Remarks
This value must be serializable, otherwise System.ArgumentException is thrown, when you will try to add or insert the CacheItem.
Examples
The following example gets value of a CacheItem.
CacheItem item = cache.GetCacheItem("Product0");
Product product = item.GetValue<Product>();