Method GetCacheStream
GetCacheStream(String, CacheStreamAttributes)
Gets an instance CacheStream
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
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);