There is no specific aspect class to add a custom attribute in Metalama, but only the advice factory method IntroduceAttribute(IDeclaration, IAttributeData, OverrideStrategy). Create an aspect class that calls this advice factory method from BuildAspect(IAspectBuilder<T>).
Namespace: PostSharp.Aspects
Assembly: Metalama.Migration.dll
Syntax
[LinesOfCodeAvoided(1)]
[Obsolete("There is no specific aspect class to add a custom attribute in Metalama, but only the advice factory method 'IAdviceFactory.IntroduceAttribute(IDeclaration, IAttributeData, OverrideStrategy)'. Create an aspect class that calls this advice factory method from 'IAspect<T>.BuildAspect(IAspectBuilder<T>)'.", false)]
public sealed class CustomAttributeIntroductionAspect : ICustomAttributeIntroductionAspect, IAspect, IAspectBuildSemantics, IValidableAnnotationConstructors
| Name | Description |
|---|---|
| CustomAttributeIntroductionAspect(ObjectConstruction) | |
| CustomAttributeIntroductionAspect(CustomAttributeData) |
Properties
| Name | Description |
|---|---|
| CustomAttribute |