LogLevelSource.LogActivityAsync<TDescription, TResult> Method (TDescription, Func<Task<TResult>>, OpenActivityOptions) |
Executes an asynchronous non-void delegate and logs its execution.
Namespace: PostSharp.Patterns.Diagnostics.Custom
Assembly: PostSharp.Patterns.Common (in PostSharp.Patterns.Common.dll) Version: 6.10.10.0 (6.10.10.0)
C#
public Task<TResult> LogActivityAsync<TDescription, TResult>( in TDescription description, Func<Task<TResult>> action, in OpenActivityOptions options = null ) where TDescription : IMessage
Parameters
- description
- Type: TDescription
The activity description, typically created using the SemanticMessageBuilder or FormattedMessageBuilder class. - action
- Type: System.Func<Task<TResult>>
The action be be executed. - options (Optional)
- Type: PostSharp.Patterns.Diagnostics.OpenActivityOptions
Options.
Type Parameters
- TDescription
- The type of the description message.
- TResult
- The type of the return value of the action to execute.
Return Value
Type: Task<TResult>A Task<TResult> whose result will be set to the result of action.