PostSharp6.2/API Reference/Post­Sharp.​Patterns.​Caching Namespace/Caching­Profile Class

CachingProfile Class

Allows for centralized and run-time configuration of several instances of the CacheAttribute aspect.
Inheritance Hierarchy

Namespace:  PostSharp.Patterns.Caching
Assembly:  PostSharp.Patterns.Caching (in PostSharp.Patterns.Caching.dll) Version: (
public sealed class CachingProfile : ICacheItemConfiguration

The CachingProfile type exposes the following members.

Public methodCachingProfile
Initializes a new CachingProfile.
Public propertyAbsoluteExpiration
Gets or sets the total duration during which the result of the current method is stored in cache. The absolute expiration time is counted from the moment the method is evaluated and cached.
Public propertyAcquireLockTimeout
Gets or sets the maximum time that the caching aspect will wait for the LockManager to acquire a lock. To specify an infinite waiting time, set this property to TimeSpan.FromMilliseconds( -1 ). The default behavior is to wait infinitely.
Public propertyAcquireLockTimeoutStrategy
Gets or sets the behavior in case that the caching aspect could not acquire a lock because of a timeout. The default behavior is to throw a TimeoutException. You can implement your own strategy by implementing the IAcquireLockTimeoutStrategy interface. If the OnTimeout(String) does not return any exception, the cached method will be evaluated (even without a lock).
Public propertyAutoReload
Determines 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.
Public propertyIsEnabled
Determines whether caching is enabled for the current profile.
Public propertyLockManager
Gets or sets the lock manager used to synchronize the execution of methods that are cached with the current profile. The default lock manager is NullLockManager, which allows for concurrent execution of all methods. An alternative implementation is LocalLockManager, which prevents concurrent execution of the same method with the same parameters, in the current process (or AppDomain).
Public propertyName
Gets the profile name (a case-insensitive string).
Public propertyPriority
Gets or sets the priority of the cached methods.
Public propertySlidingExpiration
Gets or sets the duration during which the result of the current 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.
Public fieldStatic memberDefaultName
The name of the default profile.
See Also