MetalamaAPI documentationPost­Sharp API migrationPost­Sharp.​AspectsOn­Method­Boundary­Aspect
Open sandboxFocus

OnMethodBoundaryAspect Class

In Metalama, use OverrideMethodAspect.

Inheritance
OnMethodBoundaryAspect
Namespace: PostSharp.Aspects
Assembly: Metalama.Migration.dll
Syntax
[MulticastAttributeUsage]
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.