MetalamaAPI documentationPost­Sharp API migrationPost­Sharp.​AspectsAspect
Open sandboxFocus

Aspect Class

The base aspect class in Metalama is Aspect.

Namespace: PostSharp.Aspects
Assembly: Metalama.Migration.dll
Syntax
public abstract class Aspect : MulticastAttribute, IAspect, IAspectBuildSemantics, IValidableAnnotation

Constructors

Name Description
Aspect()

Properties

Name Description
AspectPriority

It is not possible to set the aspect priority on a per-instance basis in Metalama. Instead, all aspects are statically ordered using the AspectOrderAttribute custom attribute.

SerializerType

Aspect are also serializable in Metalama, but the serializer cannot be customized.

UnsupportedTargetAction

In Metalama, it is not possible to customize the behavior when the aspect is applied to an unsupported target. An exception will be thrown.

Methods

Name Description
CompileTimeValidate(Object)

In Metalama, validation is done in BuildEligibility(IEligibilityBuilder<T>) and BuildAspect(IAspectBuilder<T>). The equivalent of returning false is to call SkipAspect().

CreateAspectConfiguration()

Not supported in Metalama.

GetAspectConfiguration(Object)

Not supported in Metalama.

SetAspectConfiguration(AspectConfiguration, Object)

Not supported in Metalama.

Explicit Interface Implementations

Name Description
IValidableAnnotation.CompileTimeValidate(Object)

In Metalama, validation is done in BuildEligibility(IEligibilityBuilder<T>) and BuildAspect(IAspectBuilder<T>). The equivalent of returning false is to call SkipAspect().