This is the online documentation for PostSharp 5.0.
Download PDF or CHM. Go to v4.3 or v5.0

BackgroundAttribute.OnInvokeAsync Method

Method invoked instead of the method to which the aspect has been applied.

Namespace:  PostSharp.Patterns.Threading
Assembly:  PostSharp.Patterns.Threading (in PostSharp.Patterns.Threading.dll) Version: 5.0.33.0 (5.0.33.0)
Syntax
C#
public override Task OnInvokeAsync(
	MethodInterceptionArgs args
)

Parameters

args
Type: PostSharp.Aspects.MethodInterceptionArgs
Advice arguments.

Return Value

Type: Task

Implements

IAsyncMethodInterceptionAspect.OnInvokeAsync(MethodInterceptionArgs)
Remarks

The implementation of OnInvokeAsync(MethodInterceptionArgs) may invoke ProceedAsync(), may schedule it for invocation from another thread, or may completely skip its invocation. Alternatively, it may use Binding. Before returning to the caller, the OnInvokeAsync(MethodInterceptionArgs) method must set the return value (property ReturnValue), otherwise the target method may fail with a NullReferenceException. It is normally set by calling ProceedAsync().

See Also