Open sandboxFocus

Class CachingServices

The entry point to configure PostSharp.Patterns.Caching at run time.

Inheritance
CachingServices
Namespace: PostSharp.Patterns.Caching
Assembly: PostSharp.Patterns.Caching.dll
Syntax
public static class CachingServices
Remarks

Set the DefaultBackend property before the first call to a cached method; otherwise, the call throws a CachingException. Use Profiles to change the configuration of cached methods at run time, CachingServices.Invalidation to remove items from the cache, CurrentContext to add dependencies to the cached method being evaluated, and DefaultKeyBuilder or CachingServices.Formatters to customize cache keys.

Properties

Name Description
CurrentContext

Gets the current caching context, so dependencies can be added.

DefaultBackend

Gets or sets the default CachingBackend, i.e. the physical storage of cache items.

DefaultKeyBuilder

Gets or sets the CacheKeyBuilder used to generate caching keys, i.e. to serialize objects into a string.

Profiles

Gets the repository of caching profiles (CachingProfile).

Methods

Name Description
SuspendDependencyPropagation()

Temporarily suspends propagation of dependencies from subsequently called methods to the caller method.

See Also