PostSharp.ILAPI ReferencePost­Sharp.​Patterns.​CachingInvalidate­Cache­Attribute
Open sandboxFocus

InvalidateCacheAttribute Class

Custom attribute that, when applied on a method, causes an invocation of this method to remove from the cache the result of invocations of other given methods with the same parameter values.

Namespace: PostSharp.Patterns.Caching
Assembly: PostSharp.Patterns.Caching.dll
Syntax
[MulticastAttributeUsage]
[Metric("UsedFeatures", "Patterns.Caching.InvalidateCache")]
[ProvideAspectRole("CacheInvalidation")]
[AspectRoleDependency]
[AspectRoleDependency]
[LinesOfCodeAvoided(1)]
[Serializer]
public sealed class InvalidateCacheAttribute : MethodInterceptionAspect, IMethodLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, IAsyncMethodInterceptionAspect, IMethodInterceptionAspect, IMethodLevelAspect, IAspect

Constructors

Name Description
InvalidateCacheAttribute(PortableFormatterConstructorContext)
InvalidateCacheAttribute(String[])

Initializes a new InvalidateCacheAttribute that invalidates method of the same type as the type to which the current InvalidateCacheAttribute aspect is being applied.

InvalidateCacheAttribute(Type, String[])

Initializes a new InvalidateCacheAttribute that invalidates method of a different type than the type to which the current InvalidateCacheAttribute aspect is being applied.

Properties

Name Description
AllowMultipleOverloads

Determines whether the current InvalidateCacheAttribute can match several overloads of the methods. The default value is false, which means that an error will be emitted if the current InvalidateCacheAttribute matches several methods of the same name.

Methods

Name Description
CompileTimeValidate(MethodBase)
OnInvoke(MethodInterceptionArgs)
OnInvokeAsync(MethodInterceptionArgs)
RuntimeInitialize(MethodBase)