Partager via


ApiController.ExecuteAsync Method

Executes asynchronously a single HTTP operation.

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

Syntax

'Declaration
Public Overridable Function ExecuteAsync ( _
    controllerContext As HttpControllerContext, _
    cancellationToken As CancellationToken _
) As Task(Of HttpResponseMessage)
'Usage
Dim instance As ApiController 
Dim controllerContext As HttpControllerContext 
Dim cancellationToken As CancellationToken 
Dim returnValue As Task(Of HttpResponseMessage)

returnValue = instance.ExecuteAsync(controllerContext, _
    cancellationToken)
public virtual Task<HttpResponseMessage> ExecuteAsync(
    HttpControllerContext controllerContext,
    CancellationToken cancellationToken
)
public:
virtual Task<HttpResponseMessage^>^ ExecuteAsync(
    HttpControllerContext^ controllerContext, 
    CancellationToken cancellationToken
)
abstract ExecuteAsync : 
        controllerContext:HttpControllerContext * 
        cancellationToken:CancellationToken -> Task<HttpResponseMessage> 
override ExecuteAsync : 
        controllerContext:HttpControllerContext * 
        cancellationToken:CancellationToken -> Task<HttpResponseMessage> 
public function ExecuteAsync(
    controllerContext : HttpControllerContext, 
    cancellationToken : CancellationToken
) : Task<HttpResponseMessage>

Parameters

Return Value

Type: System.Threading.Tasks.Task<HttpResponseMessage>
The newly started task.

Implements

IHttpController.ExecuteAsync(HttpControllerContext, CancellationToken)

See Also

Reference

ApiController Class

System.Web.Http Namespace