MetalamaAPI documentationPost­Sharp API migrationPost­Sharp.​AspectsMethod­Execution­Args
Open sandboxFocus

MethodExecutionArgs Class

In PostSharp, this object exposed the run-time execution context to the advice. However, in Metalama, advice do not execute at run time. Instead, advice are templates that generate run-time code. This run-time code does not need helper objects to represent the execution context.

Inheritance
MethodExecutionArgs
Namespace: PostSharp.Aspects
Assembly: Metalama.Migration.dll
Syntax
public class MethodExecutionArgs : AdviceArgs

Properties

Name Description
Arguments

In Metalama, use meta.Target.Parameters

Exception

In Metalama, when you have your own try/catch, this is the exception variable of the catch block.

FlowBehavior

There is no equivalent in Metalama because you can code any control flow in the template.

Method

In Metalama, use meta.Target.Method. If you need a run-time object, call IMethod.ToMethodInfo().

MethodExecutionTag

In Metalama, use a local variable in the template.

ReturnValue

In Metalama, when you call meta.Proceed(), store the return value in a local variable.

YieldValue

There is no equivalent in Metalama and no workaround.