In Metalama, use TypeAspect. Note that aspects in Metalama have no run-time existence, so they cannot be instance-scoped. While porting a PostSharp InstanceLevelAspect into Metalama, you would typically introduce instance fields or properties into the target type, and use an initializer to initialize them.
Implements
Namespace: PostSharp.Aspects
Assembly: Metalama.Migration.dll
Syntax
[MulticastAttributeUsage(MulticastTargets.Class, TargetTypeAttributes = MulticastAttributes.Instance)]
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Interface, AllowMultiple = true)]
[Obsolete("In Metalama, use 'TypeAspect'. Note that aspects in Metalama have no run-time existence, so they cannot be instance-scoped. While porting a PostSharp 'InstanceLevelAspect' into Metalama, you would typically introduce instance fields or properties into the target type, and use an initializer to initialize them.", false)]
public abstract class InstanceLevelAspect : TypeLevelAspect, ITypeLevelAspect, ITypeLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, ICloneAwareAspect, IInstanceScopedAspect, IAspect
Constructors
Name | Description |
---|---|
InstanceLevelAspect() |
Properties
Name | Description |
---|---|
Instance |
Methods
Name | Description |
---|---|
CreateAspectConfiguration() | Not supported in Metalama. |
CreateInstance(AdviceArgs) | No equivalent in Metalama. |
OnCloned(ICloneAwareAspect) | Not implemented in Metalama. |
RuntimeInitializeInstance() | Typically, add an initializer using |