PostSharp SDK 6.10 / / Class Reference / Post­Sharp.​Sdk.​Code­Model Namespace / Method­Def­Declaration Class / Method­Def­Declaration Properties / Method­Def­Declaration.​May­Have­Body Property

MethodDefDeclaration.MayHaveBody Property

Determines whether this method may have a body.

Namespace:  PostSharp.Sdk.CodeModel
Assembly:  PostSharp.Compiler.Engine (in PostSharp.Compiler.Engine.dll) Version: (
public bool MayHaveBody { get; }

Property Value

Type: Boolean
The difference with HasBody is that property returns true if the method body is not yet implemented, for instance because it was marked as external in C#. But the method would accept a method body. The current property returns false even if the current method has a body, but may not.
See Also