ApiControllerInitializeMethodSample.Infrastructure.ApiControllerBase.ExecuteAsync C# (CSharp) Метод

ExecuteAsync() публичный Метод

public ExecuteAsync ( System.Web.Http.Controllers.HttpControllerContext controllerContext, System cancellationToken ) : Task
controllerContext System.Web.Http.Controllers.HttpControllerContext
cancellationToken System
Результат Task
        public override Task<HttpResponseMessage> ExecuteAsync(HttpControllerContext controllerContext, System.Threading.CancellationToken cancellationToken) {

            return base.ExecuteAsync(controllerContext, cancellationToken).ContinueWith(task => {
                var response = task.Result;
                response.Headers.Add("X-Foo", "Bar");

                return response;
            });
        }
    }