Method GetCacheStream
GetCacheStream(String, CacheStreamAttributes)
Gets a CacheStream instance.
Declaration
CacheStream GetCacheStream(string key, CacheStreamAttributes cacheStreamAttributes = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key used to reference the stream. |
CacheStreamAttributes | cacheStreamAttributes | Instance of CacheStreamAttributes to set attributes of the stream. |
Returns
Type | Description |
---|---|
CacheStream | 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);