ITraceWriterExtensions.TraceBeginEndAsync Method

 

Namespace:   System.Web.Http.Tracing
Assembly:  System.Web.Http (in System.Web.Http.dll)

Overload List

Name Description
System_CAPS_pubmethodSystem_CAPS_static TraceBeginEndAsync(ITraceWriter, HttpRequestMessage, String, TraceLevel, String, String, Action<TraceRecord>, Func<Task>, Action<TraceRecord>, Action<TraceRecord>)

Traces both a begin and an end trace around a specified operation.

System_CAPS_pubmethodSystem_CAPS_static TraceBeginEndAsync<TResult>(ITraceWriter, HttpRequestMessage, String, TraceLevel, String, String, Action<TraceRecord>, Func<Task<TResult>>, Action<TraceRecord, TResult>, Action<TraceRecord>)

Traces both a begin and an end trace around a specified operation.

See Also

ITraceWriterExtensions Class
System.Web.Http.Tracing Namespace

Return to top

ITraceWriterExtensions.TraceBeginEndAsync Method (ITraceWriter, HttpRequestMessage, String, TraceLevel, String, String, Action<TraceRecord>, Func<Task>, Action<TraceRecord>, Action<TraceRecord>)

Traces both a begin and an end trace around a specified operation.

Syntax

public static Task TraceBeginEndAsync(
    this ITraceWriter traceWriter,
    HttpRequestMessage request,
    string category,
    TraceLevel level,
    string operatorName,
    string operationName,
    Action<TraceRecord> beginTrace,
    Func<Task> execute,
    Action<TraceRecord> endTrace,
    Action<TraceRecord> errorTrace
)
public:
[ExtensionAttribute]
static Task^ TraceBeginEndAsync(
    ITraceWriter^ traceWriter,
    HttpRequestMessage^ request,
    String^ category,
    TraceLevel level,
    String^ operatorName,
    String^ operationName,
    Action<TraceRecord^>^ beginTrace,
    Func<Task^>^ execute,
    Action<TraceRecord^>^ endTrace,
    Action<TraceRecord^>^ errorTrace
)
static member TraceBeginEndAsync : 
        traceWriter:ITraceWriter *
        request:HttpRequestMessage *
        category:string *
        level:TraceLevel *
        operatorName:string *
        operationName:string *
        beginTrace:Action<TraceRecord> *
        execute:Func<Task> *
        endTrace:Action<TraceRecord> *
        errorTrace:Action<TraceRecord> -> Task
<ExtensionAttribute>
Public Shared Function TraceBeginEndAsync (
    traceWriter As ITraceWriter,
    request As HttpRequestMessage,
    category As String,
    level As TraceLevel,
    operatorName As String,
    operationName As String,
    beginTrace As Action(Of TraceRecord),
    execute As Func(Of Task),
    endTrace As Action(Of TraceRecord),
    errorTrace As Action(Of TraceRecord)
) As Task

Parameters

  • category
    Type: System.String

    The logical category of the trace.

  • operatorName
    Type: System.String

    The name of the object performing the operation. It may be null.

  • operationName
    Type: System.String

    The name of the operation being performed. It may be null.

  • execute
    Type: System.Func<Task>

    An <see cref="T:System.Func`1" /> that returns the Task that will perform the operation.

Return Value

Type: System.Threading.Tasks.Task

The Task returned by the operation.

Return to top

ITraceWriterExtensions.TraceBeginEndAsync<TResult> Method (ITraceWriter, HttpRequestMessage, String, TraceLevel, String, String, Action<TraceRecord>, Func<Task<TResult>>, Action<TraceRecord, TResult>, Action<TraceRecord>)

Traces both a begin and an end trace around a specified operation.

Syntax

public static Task<TResult> TraceBeginEndAsync<TResult>(
    this ITraceWriter traceWriter,
    HttpRequestMessage request,
    string category,
    TraceLevel level,
    string operatorName,
    string operationName,
    Action<TraceRecord> beginTrace,
    Func<Task<TResult>> execute,
    Action<TraceRecord, TResult> endTrace,
    Action<TraceRecord> errorTrace
)
public:
generic<typename TResult>
[ExtensionAttribute]
static Task<TResult>^ TraceBeginEndAsync(
    ITraceWriter^ traceWriter,
    HttpRequestMessage^ request,
    String^ category,
    TraceLevel level,
    String^ operatorName,
    String^ operationName,
    Action<TraceRecord^>^ beginTrace,
    Func<Task<TResult>^>^ execute,
    Action<TraceRecord^, TResult>^ endTrace,
    Action<TraceRecord^>^ errorTrace
)
static member TraceBeginEndAsync<'TResult> : 
        traceWriter:ITraceWriter *
        request:HttpRequestMessage *
        category:string *
        level:TraceLevel *
        operatorName:string *
        operationName:string *
        beginTrace:Action<TraceRecord> *
        execute:Func<Task<'TResult>> *
        endTrace:Action<TraceRecord, 'TResult> *
        errorTrace:Action<TraceRecord> -> Task<'TResult>
<ExtensionAttribute>
Public Shared Function TraceBeginEndAsync(Of TResult) (
    traceWriter As ITraceWriter,
    request As HttpRequestMessage,
    category As String,
    level As TraceLevel,
    operatorName As String,
    operationName As String,
    beginTrace As Action(Of TraceRecord),
    execute As Func(Of Task(Of TResult)),
    endTrace As Action(Of TraceRecord, TResult),
    errorTrace As Action(Of TraceRecord)
) As Task(Of TResult)

Parameters

  • category
    Type: System.String

    The logical category of the trace.

  • operatorName
    Type: System.String

    The name of the object performing the operation. It may be null.

  • operationName
    Type: System.String

    The name of the operation being performed. It may be null.

  • execute
    Type: System.Func<Task<TResult>>

    An <see cref="T:System.Func`1" /> that returns the Task that will perform the operation.

  • endTrace
    Type: System.Action<TraceRecord, TResult>

    The Action to invoke after successfully performing the operation, allowing the given TraceRecord to be filled in. The result of the completed task will also be passed to this action. This action may be null.

Return Value

Type: System.Threading.Tasks.Task<TResult>

The Task returned by the operation.

Type Parameters

  • TResult
    The type of result produced by the Task.

Return to top