Class CacheManagerOutputCacheProvider
Implements a simple System.Web.Caching.OutputCacheProvider which uses a cache manager configured via web.config.
Inherited Members
Namespace:CacheManager.Web
Assembly:CacheManager.Web.dll
Syntax
public class CacheManagerOutputCacheProvider : OutputCacheProvider
Properties
| Improve this Doc View SourceCache
Gets the cache.
Declaration
public static ICacheManager<object> Cache { get; }
Property Value
Type | Description |
---|---|
ICacheManager<Object> | The cache. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Output cache provider has not yet been initialized. |
Methods
| Improve this Doc View SourceAdd(String, Object, DateTime)
Inserts the specified entry into the output cache.
Declaration
public override object Add(string key, object entry, DateTime utcExpiry)
Parameters
Type | Name | Description |
---|---|---|
String | key | A unique identifier for entry. |
Object | entry | The content to add to the output cache. |
DateTime | utcExpiry | The time and date on which the cached entry expires. |
Returns
Type | Description |
---|---|
Object | A reference to the specified provider. |
Overrides
| Improve this Doc View SourceGet(String)
Returns a reference to the specified entry in the output cache.
Declaration
public override object Get(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | A unique identifier for a cached entry in the output cache. |
Returns
Type | Description |
---|---|
Object | The key value that identifies the specified entry in the cache, or null if the specified entry is not in the cache. |
Overrides
| Improve this Doc View SourceInitialize(String, NameValueCollection)
Initializes the provider.
Declaration
public override void Initialize(string name, NameValueCollection config)
Parameters
Type | Name | Description |
---|---|---|
String | name | The friendly name of the provider. |
NameValueCollection | config | A collection of the name/value pairs representing the provider-specific attributes specified in the configuration for this provider. |
Overrides
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Might be re thrown. |
Remove(String)
Removes the specified entry from the output cache.
Declaration
public override void Remove(string key)
Parameters
Type | Name | Description |
---|---|---|
String | key | The unique identifier for the entry to remove from the output cache. |
Overrides
| Improve this Doc View SourceSet(String, Object, DateTime)
Inserts the specified entry into the output cache, overwriting the entry if it is already cached.
Declaration
public override void Set(string key, object entry, DateTime utcExpiry)
Parameters
Type | Name | Description |
---|---|---|
String | key | A unique identifier for entry. |
Object | entry | The content to add to the output cache. |
DateTime | utcExpiry | The time and date on which the cached entry expires. |