Open sandboxFocus

Class OnMethodBoundaryAspect

In Metalama, use OverrideMethodAspect.

Inheritance
OnMethodBoundaryAspect
Namespace: PostSharp.Aspects
Assembly: Metalama.Migration.dll
Syntax
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Constructor|AttributeTargets.Method|AttributeTargets.Property|AttributeTargets.Event|AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
[MulticastAttributeUsage(MulticastTargets.Method|MulticastTargets.InstanceConstructor|MulticastTargets.StaticConstructor, AllowMultiple = true, TargetMemberAttributes = MulticastAttributes.NonAbstract)]
[Obsolete("In Metalama, use 'OverrideMethodAspect'.", false)]
public abstract class OnMethodBoundaryAspect : MethodLevelAspect, IMethodLevelAspectBuildSemantics, IAspectBuildSemantics, IValidableAnnotation, IOnStateMachineBoundaryAspect, IOnMethodBoundaryAspect, IMethodLevelAspect, IAspect

Constructors

Name Description
OnMethodBoundaryAspect()

Properties

Name Description
SemanticallyAdvisedMethodKinds

In Metalama, implement different methods OverrideMethod(), OverrideAsyncMethod(), OverrideEnumerableMethod() or OverrideEnumeratorMethod(), and set the properties UseAsyncTemplateForAnyAwaitable or UseEnumerableTemplateForAnyEnumerable.

UnsupportedTargetAction

There is no equivalent in Metalama. Unsupported targets will throw an exception.

Methods

Name Description
CreateAspectConfiguration()

Not supported in Metalama.

OnEntry(MethodExecutionArgs)

Implement OverrideMethod() and add this logic before the call to meta.Proceed().

OnException(MethodExecutionArgs)

Implement OverrideMethod(), call meta.Proceed() in a try/catch block, and add this logic to the catch block.

OnExit(MethodExecutionArgs)

Implement OverrideMethod(), call meta.Proceed() in a try/finally block, and add this logic to the finally block.

OnResume(MethodExecutionArgs)

This feature is not implemented in Metalama and there is no workaround.

OnSuccess(MethodExecutionArgs)

Implement OverrideMethod(), call meta.Proceed() in a try/catch block, and add this logic to the end of the try block.

OnYield(MethodExecutionArgs)

This feature is not implemented in Metalama and there is no workaround.

SetAspectConfiguration(AspectConfiguration, MethodBase)

Not supported in Metalama.

Extension Methods