A base class for aspects that target generic type parameter declarations.
Implements
Namespace: Metalama.Framework.Aspects
Assembly: Metalama.Framework.dll
Syntax
[AttributeUsage(AttributeTargets.GenericParameter)]
public abstract class TypeParameterAspect : Aspect, IAspect<ITypeParameter>, IAspect, ICompileTimeSerializable, ITemplateProvider, IEligible<ITypeParameter>Remarks
This class provides a convenient base for creating generic type parameter aspects by implementing IAspect<T>
with T set to ITypeParameter. Derived classes override BuildAspect(IAspectBuilder<ITypeParameter>)
to add advice (such as adding constraints, attributes, or validation) to the target generic type parameter.
This is a convenience base class. The aspect framework primarily requires implementation of IAspect<T>.
Constructors
| Name | Description |
|---|---|
| TypeParameterAspect() |
Methods
| Name | Description |
|---|---|
| BuildAspect(IAspectBuilder<ITypeParameter>) | Defines the aspect implementation by adding advice, child aspects, and validators to the target declaration. |
| BuildEligibility(IEligibilityBuilder<ITypeParameter>) | Configures the eligibility of the aspect or attribute by defining rules that determine which declarations the aspect can be applied to. |