PostSharpAPI ReferencePost­Sharp.​AspectsFlow­BehaviorReturn
Open sandboxFocus

FlowBehavior.Return Field

Return immediately from the current method. Available only for OnEntry(MethodExecutionArgs) and OnException(MethodExecutionArgs). Note that you may want to set the ReturnValue property, otherwise you may get a NullReferenceException. If there is another OnMethodBoundaryAspect aspect before the current OnMethodBoundaryAspect aspect on the current method, the Return behavior calls the OnSuccess(MethodExecutionArgs) and OnExit(MethodExecutionArgs) methods of the other aspect.

Namespace: PostSharp.Aspects
Assembly: PostSharp.dll
Syntax
public const FlowBehavior Return
Returns
Type Description
FlowBehavior
Remarks

If the advice is applied semantically to an iterator method in OnEntry(MethodExecutionArgs), it means that the call to MoveNext() should return false and the enumerator should thus behave as empty.