PostSharpAPI ReferencePost­Sharp.​Reflection.​Method­BodyIMethod­Body­ServiceGet­Method­Body
Open sandboxFocus

IMethodBodyService.GetMethodBody Method

GetMethodBody(MethodBase, MethodBodyAbstractionLevel)

Decompiles a method and gets an AST representation of it.

Declaration
IMethodBody GetMethodBody(MethodBase method, MethodBodyAbstractionLevel abstractionLevel)
Parameters
Type Name Description
System.Reflection.MethodBase method

The method to decompile.

MethodBodyAbstractionLevel abstractionLevel

The required level of abstraction and detail.

Returns
Type Description
IMethodBody

AST representing the method at the required level of abstraction and detail.