Custom attribute that, when applied on a method of an aspect class, specifies that this method is an advice that has the same semantics as OnInvokeAsync(MethodInterceptionArgs).
Inheritance
Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp.dll
Syntax
[AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public sealed class OnMethodInvokeAsyncAdvice : OnMethodInvokeBaseAdviceRemarks
The method to which this custom attribute is applied must be public. It can be static. It can have the same signature as OnInvokeAsync(MethodInterceptionArgs). It can also have parameters that receive a value of the target, each selected by a custom attribute derived from AdviceParameterAttribute: ThisAttribute, ArgumentAttribute, ArgumentsAttribute, BindingAttribute (as an IAsyncMethodBinding), DeclarationAttribute, DeclarationNameAttribute, DeclarationIdentifierAttribute or ImportMemberAttribute, all passed by value. These parameters can follow a MethodInterceptionArgs parameter, or replace it.
The method returns a Task or a Task<TResult>. The result of a Task<TResult> becomes the result of the target method. Its type is the result type of the target method, object, or a type parameter of the method, which is inferred from the result type of the target method.
Constructors
| Name | Description |
|---|---|
| OnMethodInvokeAsyncAdvice() |