Open sandboxFocus

Class InvalidateCacheAttribute

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.

Inheritance
InvalidateCacheAttribute
Namespace: Metalama.Patterns.Caching.Aspects
Assembly: Metalama.Patterns.Caching.Aspects.dll
Syntax
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public sealed class InvalidateCacheAttribute : MethodAspect, IAspect<IMethod>, IAspect, ICompileTimeSerializable, ITemplateProvider, IEligible<IMethod>

Constructors

Name Description
InvalidateCacheAttribute(params string[])

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

InvalidateCacheAttribute(Type, params string[])

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

Properties

Name Description
AllowMultipleOverloads

Gets or sets a value indicating 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
BuildAspect(IAspectBuilder<IMethod>)

Initializes the aspect. The implementation must add advice, child aspects and validators using the builder parameter.

BuildEligibility(IEligibilityBuilder<IMethod>)

Configures the eligibility of the aspect or attribute. Implementations are not allowed to reference non-static members. Implementations must call the implementation of the base class if it exists.

InitializeMethodInfoArray(IReadOnlyList<IMethod>, IField)