C# Class NContext.Extensions.AspNet.WebApi.Handlers.ExecutionContextMessageHandler

Defines a message handler which creates an identifier for the incoming ExecutionContext flow. This can be later used across asyncronous operations and threads to uniquely identify the execution context. This may be useful if you wish to cache data per-request (ie. HttpContext.Current.Items). Since a single request/response may execute across multiple threads we need to identify the data somehow. This is similar to how Thread.CurrentPrincipal and Culture work.
Inheritance: System.Net.Http.DelegatingHandler
Show file Open project: PowerDMS/NContext

Protected Methods

Method Description
SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task

Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.

Private Methods

Method Description
SetExecutionContextId ( System.Guid executionContextId ) : void

Method Details

SendAsync() protected method

Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.
protected SendAsync ( HttpRequestMessage request, CancellationToken cancellationToken ) : Task
request System.Net.Http.HttpRequestMessage The HTTP request message to send to the server.
cancellationToken System.Threading.CancellationToken A cancellation token to cancel operation.
return Task