コード例 #1
0
 public void OnActionExecuting(ActionExecutingContext context)
 {
     var requestContext = context.GetServiceProvider().GetServiceOrThrow<IRequestContext>();
     PopulateAsyncInformation(requestContext, context);
     PopulateRequestIdentifierInformation(requestContext, context);
     PopulateRequestIdentityInformation(requestContext, context);
 }
コード例 #2
0
        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);
        }