Open sandboxFocus

Class CachingOptionsBuilder

Builder class for configuring caching options through the ConfigureCaching(IQuery<IMethod>, Action<CachingOptionsBuilder>) fabric extension method.

Inheritance
CachingOptionsBuilder
Namespace: Metalama.Patterns.Caching.Aspects.Configuration
Assembly: Metalama.Patterns.Caching.Aspects.dll
Syntax
[CompileTime]
public sealed class CachingOptionsBuilder
Remarks

This class provides the same configuration options as CachingConfigurationAttribute, but can be used programmatically in fabrics for more fine-grained control over caching configuration.

Constructors

Name Description
CachingOptionsBuilder()

Properties

Name Description
AbsoluteExpiration

Gets or sets the total duration during which the result of the cached method is stored in cache. The absolute expiration time is counted from the moment the method is evaluated and cached.

AutoReload

Gets or sets a value indicating whether the method calls are automatically reloaded (by re-evaluating the target method with the same arguments) when the cache item is removed from the cache.

IgnoreThisParameter

Gets or sets a value indicating whether the this instance should be a part of the cache key. The default value of this property is false, which means that by default the this instance is a part of the cache key.

IsEnabled
Priority

Gets or sets the priority of the cached method.

ProfileName

Gets or sets the name of the CachingProfile that contains the configuration of the cached methods.

SlidingExpiration

Gets or sets the duration during which the result of the cached method is stored in cache after it has been added to or accessed from the cache. The expiration is extended every time the value is accessed from the cache.

UseDependencyInjection

Methods

Name Description
AddParameterClassifier(string, ICacheParameterClassifier)

Registers a parameter classifier that determines how method parameters are handled in cache key generation.

RemoveParameterClassifier(string)

Removes a previously registered parameter classifier by name.

Extension Methods

See Also