public void OnActionExecuting(ActionExecutingContext context) { var requestContext = context.GetServiceProvider().GetServiceOrThrow<IRequestContext>(); PopulateAsyncInformation(requestContext, context); PopulateRequestIdentifierInformation(requestContext, context); PopulateRequestIdentityInformation(requestContext, context); }
public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) { var requestContext = context.GetServiceProvider().GetServiceOrThrow <IRequestContext>(); if (!requestContext.IsAsync) { await next(); return; } ReturnAccepted(context); await ProcessRequestAsynchronously(context, requestContext); }