Open sandboxFocus

Property Method

Method

Gets the method being executed.

Declaration
public MethodBase Method { get; set; }
Property Value
Type Description
MethodBase
Remarks
<p>If the executed method is generic or if its declaring type is generic,
  the current property contains the generic instance being executed.</p>
<div class="NOTE"><h5>note</h5><p>
  Using this property causes the aspect weaver to generate code that has non-trivial runtime overhead. Avoid using
  this property whenever possible. One of the possible solution is to use compile-time initialization of
  aspect instances and to make use of reflection only at build time. See <xref href="PostSharp.Aspects.MethodLevelAspect.CompileTimeInitialize(System.Reflection.MethodBase%2cPostSharp.Aspects.AspectInfo)" data-throw-if-not-resolved="false"></xref>
  for details.
</p></div>
<div class="NOTE"><h5>note</h5><p>

As a result of weaving optimizations, value of this property may be seen as null in a debugger. If you need to inspect the value in runtime, consider disabling aspect optimizations in the debug build configuration.

See Also