Method GetCacheStream
GetCacheStream(String, StreamMode)
Gets an instance of the CacheStream class.
Declaration
public virtual CacheStream GetCacheStream(string key, StreamMode streamMode)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key used to reference the stream. |
StreamMode | streamMode | Enumeration to specify the desired mode to open the stream. |
Returns
Type | Description |
---|---|
CacheStream | An instance of CacheStream |
GetCacheStream(String, StreamMode, CacheItemPriority)
Gets an instance of the CacheStream class. You can specify the cache item priority as well.
Declaration
public virtual CacheStream GetCacheStream(string key, StreamMode streamMode, CacheItemPriority priority)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key used to reference the stream. |
StreamMode | streamMode | Enumeration to specify the desired mode to open the stream. |
CacheItemPriority | priority | The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost. |
Returns
Type | Description |
---|---|
CacheStream | An instance of CacheStream |
GetCacheStream(String, StreamMode, DateTime, TimeSpan, CacheItemPriority)
Gets an instance of the CacheStream class. Expirations can be specified along with priority.
Declaration
public virtual CacheStream GetCacheStream(string key, StreamMode streamMode, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key used to reference the stream. |
StreamMode | streamMode | Enumeration to specify the desired mode to open the stream. |
System.DateTime | absoluteExpiration | The time at which the added stream expires and is removed from the cache. If absolute expiration is not desired, specify Cache.NoAbsoluteExpiration |
System.TimeSpan | slidingExpiration | The interval between the time the added stream was last accessed and when it expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed. If sliding expiration is not desired, specify Cache.NoSlidingExpiration |
CacheItemPriority | priority | The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost. |
Returns
Type | Description |
---|---|
CacheStream | An instance of CacheStream |
GetCacheStream(String, String, String, StreamMode, CacheItemPriority)
Gets an instance of the CacheStream class. Groups and subgroups can be specified with priority of the cache item.
Declaration
public virtual CacheStream GetCacheStream(string key, string group, string subgroup, StreamMode streamMode, CacheItemPriority priority)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key used to reference the stream. |
System.String | group | The group whose keys are to be returned. |
System.String | subgroup | |
StreamMode | streamMode | Enumeration to specify the desired mode to open the stream. |
CacheItemPriority | priority | The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost. |
Returns
Type | Description |
---|---|
CacheStream | An instance of CacheStream |
GetCacheStream(String, String, String, StreamMode, DateTime, TimeSpan, CacheItemPriority)
Gets an instance of the CacheStream class. Groups and subgroups can be specified with this overload along with expirations and priority.
Declaration
public virtual CacheStream GetCacheStream(string key, string group, string subgroup, StreamMode streamMode, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The key used to reference the stream. |
System.String | group | The group whose keys are to be returned. |
System.String | subgroup | |
StreamMode | streamMode | Enumeration to specify the desired mode to open the stream. |
System.DateTime | absoluteExpiration | The time at which the added stream expires and is removed from the cache. If absolute expiration is not desired, specify Cache.NoAbsoluteExpiration |
System.TimeSpan | slidingExpiration | The interval between the time the added stream was last accessed and when it expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed. If sliding expiration is not desired, specify Cache.NoSlidingExpiration |
CacheItemPriority | priority | The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost. |
Returns
Type | Description |
---|---|
CacheStream | An instance of CacheStream |
GetCacheStream(String, String, String, StreamMode, CacheDependency, DateTime, TimeSpan, CacheItemPriority)
Gets an instance of the CacheStream class. You can specify if dependency exists. Also groups, subgroups, expiration and priority can be specified.
Declaration
public virtual CacheStream GetCacheStream(string key, string group, string subGroup, StreamMode streamMode, CacheDependency dependency, DateTime absoluteExpiration, TimeSpan slidingExpiration, CacheItemPriority priority)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | The cache key used to reference the item. |
System.String | group | The group whose keys are to be returned. |
System.String | subGroup | The sub group of the group foe which keys are to be returned. |
StreamMode | streamMode | Enumeration to specify the desired mode to open the stream. |
CacheDependency | dependency | CacheDependency to be added. When any dependency changes, the object becomes invalid and is removed from the cache. If there are no dependencies, this parameter contains a null reference. |
System.DateTime | absoluteExpiration | The time at which the added stream expires and is removed from the cache. If absolute expiration is not desired, specify Cache.NoAbsoluteExpiration |
System.TimeSpan | slidingExpiration | The interval between the time the added stream was last accessed and when it expires. If this value is the equivalent of 20 minutes, the object expires and is removed from the cache 20 minutes after it is last accessed. If sliding expiration is not desired, specify Cache.NoSlidingExpiration |
CacheItemPriority | priority | The relative cost of the object, as expressed by the CacheItemPriority enumeration. The cache uses this value when it evicts objects; objects with a lower cost are removed from the cache before objects with a higher cost. |
Returns
Type | Description |
---|---|
CacheStream | An instance of CacheStream |