Method GetCacheStream
GetCacheStream(String, CacheStreamAttributes)
Gets a Cache
Declaration
CacheStream GetCacheStream(string key, CacheStreamAttributes cacheStreamAttributes = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
key | The key used to reference the stream. |
Cache |
cacheStreamAttributes | Instance of Cache |
Returns
Type | Description |
---|---|
Cache |
An instance of CacheStream. |
Examples
The following example demonstrates how to get the cache stream with Stream mode, Expiration and Cache Item Priority. box server control.
ICache cache = CacheManager.GetCache("demoClusteredCache");
string key = "Product1";
CacheStreamAttributes cacheStreamAttributes = new CacheStreamAttributes(StreamMode.ReadWithoutLock);
cacheStreamAttributes.CacheItemPriority = CacheItemPriority.Normal;
cacheStreamAttributes.Expiration = new Expiration(ExpirationType.None);
cache.GetCacheStream("abc", cacheStreamAttributes);