Class ConfigurationBuilderCacheHandlePart
Used to build a CacheHandleConfiguration
.
Inherited Members
Namespace:CacheManager.Core
Assembly:CacheManager.Core.dll
Syntax
public sealed class ConfigurationBuilderCacheHandlePart
Properties
| Improve this Doc View SourceAnd
Gets the parent builder part to add another cache configuration. Can be used to add multiple cache handles.
Declaration
public ConfigurationBuilderCachePart And { get; }
Property Value
Type | Description |
---|---|
ConfigurationBuilderCachePart | The parent builder part. |
Methods
| Improve this Doc View SourceBuild()
Hands back the new CacheManagerConfiguration instance.
Declaration
public ICacheManagerConfiguration Build()
Returns
Type | Description |
---|---|
ICacheManagerConfiguration |
DisablePerformanceCounters()
Disables performance counters for this cache handle.
Declaration
public ConfigurationBuilderCacheHandlePart DisablePerformanceCounters()
Returns
Type | Description |
---|---|
ConfigurationBuilderCacheHandlePart | The builder part. |
DisableStatistics()
Disables statistic gathering for this cache handle.
This also disables performance counters as statistics are required for the counters.
Declaration
public ConfigurationBuilderCacheHandlePart DisableStatistics()
Returns
Type | Description |
---|---|
ConfigurationBuilderCacheHandlePart | The builder part. |
EnablePerformanceCounters()
Enables performance counters for this cache handle.
This also enables statistics, as this is required for performance counters.
Declaration
public ConfigurationBuilderCacheHandlePart EnablePerformanceCounters()
Returns
Type | Description |
---|---|
ConfigurationBuilderCacheHandlePart | The builder part. |
EnableStatistics()
Enables statistic gathering for this cache handle.
The statistics can be accessed via cacheHandle.Stats.GetStatistic.
Declaration
public ConfigurationBuilderCacheHandlePart EnableStatistics()
Returns
Type | Description |
---|---|
ConfigurationBuilderCacheHandlePart | The builder part. |
WithExpiration(ExpirationMode, TimeSpan)
Sets the expiration mode and timeout of the cache handle.
Declaration
public ConfigurationBuilderCacheHandlePart WithExpiration(ExpirationMode expirationMode, TimeSpan timeout)
Parameters
Type | Name | Description |
---|---|---|
ExpirationMode | expirationMode | The expiration mode. |
TimeSpan | timeout | The timeout. |
Returns
Type | Description |
---|---|
ConfigurationBuilderCacheHandlePart | The builder part. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | If expiration mode is not set to 'None', timeout cannot be zero. |
InvalidOperationException | Thrown if expiration mode is not 'None' and timeout is zero. |