Custom attribute that, when applied to a declaration, prevents specified aspect types from being applied to this declaration and all its members, except when the aspect is explicitly added as a custom attribute on the declaration.
Namespace: Metalama.Framework.Aspects
Assembly: Metalama.Framework.dll
Syntax
[AttributeUsage(AttributeTargets.All)]
public sealed class ExcludeAspectAttribute : AttributeRemarks
This attribute is useful for excluding aspects that would otherwise be applied through:
- Aspect inheritance: Prevents inherited aspects from propagating to this declaration
- Fabrics: Prevents fabric-added aspects from targeting this declaration
- Child aspects: Prevents child aspects from being added to this declaration by other aspects
Aspects explicitly applied as custom attributes directly on the declaration are not excluded. This allows intentional opt-in for specific declarations while excluding automatic application.
Constructors
| Name | Description |
|---|---|
| ExcludeAspectAttribute(params Type[]) | Initializes a new instance of the ExcludeAspectAttribute class. |
Properties
| Name | Description |
|---|---|
| Justification | Gets or sets the justification of the exclusion. |