Open sandboxFocus

Class NotCacheKeyAttribute

Custom attribute that, when applied to a parameter of a cached method (i.e. a method enhanced by the CacheAttribute aspect), excludes this parameter from being a part of the cache key.

Inheritance
NotCacheKeyAttribute
Namespace: Metalama.Patterns.Caching
Assembly: Metalama.Patterns.Caching.dll
Syntax
[AttributeUsage(AttributeTargets.Parameter)]
public sealed class NotCacheKeyAttribute : Attribute
Remarks

Use this attribute to exclude parameters that don't affect the method's return value but may vary between calls, such as correlation IDs, loggers, or cancellation tokens. Note that CancellationToken parameters are automatically excluded by default.

For excluding parameters by rule across multiple methods, consider implementing the ICacheParameterClassifier interface.

Constructors

Name Description
NotCacheKeyAttribute()

Extension Methods

See Also