/// <summary>
        /// Processes the HTTP request for controllers.
        /// </summary>
        /// <param name="containerProvider">The DI container provider.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public Task ProcessRequest(IDIContainerProvider containerProvider, IOwinContext context)
        {
            var result = _controllersProcessor.ProcessControllers(containerProvider, context);

            switch (result)
            {
            case ControllersProcessorResult.Ok:
                return(_pageProcessor.ProcessPage(containerProvider, context));

            case ControllersProcessorResult.Http401:
                context.Response.StatusCode = 401;
                _redirector.SetLoginReturnUrlFromCurrentUri();
                break;

            case ControllersProcessorResult.Http403:
                context.Response.StatusCode = 403;
                break;

            case ControllersProcessorResult.Http404:
                context.Response.StatusCode = 404;
                break;
            }

            return(Task.Delay(0));
        }
        /// <summary>
        /// Processes the HTTP request for controllers.
        /// </summary>
        /// <param name="resolver">THE DI container resolver</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public RequestHandlingResult ProcessRequest(IDIResolver resolver, HttpContext context)
        {
            var result = _controllersProcessor.ProcessControllers(resolver, context);

            switch (result)
            {
            case ControllersProcessorResult.Ok:
                return(_pageProcessor.ProcessPage(resolver, context));

            case ControllersProcessorResult.Http401:
                context.Response.StatusCode = 401;
                _redirector.SetLoginReturnUrlFromCurrentUri();
                break;

            case ControllersProcessorResult.Http403:
                context.Response.StatusCode = 403;
                break;

            case ControllersProcessorResult.Http404:
                if (ApplicationBuilderExtensions.TerminalMiddleware)
                {
                    context.Response.StatusCode = 404;
                }
                else
                {
                    return(RequestHandlingResult.UnhandledResult());
                }
                break;
            }

            return(RequestHandlingResult.HandledResult());
        }
        /// <summary>
        /// Processes the HTTP request for controllers.
        /// </summary>
        /// <param name="resolver">THE DI container resolver</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public async Task <RequestHandlingStatus> ProcessRequest(IDIResolver resolver, HttpContext context)
        {
            var result = await _controllersProcessor.ProcessControllers(resolver, context);

            switch (result)
            {
            case ControllersProcessorResult.Ok:
                return(await _pageProcessor.ProcessPage(resolver, context));

            case ControllersProcessorResult.Http401:
                context.Response.StatusCode = 401;
                _redirector.SetLoginReturnUrlFromCurrentUri();
                break;

            case ControllersProcessorResult.Http403:
                context.Response.StatusCode = 403;
                break;

            case ControllersProcessorResult.Http404:
                if (TerminalMiddleware)
                {
                    context.Response.StatusCode = 404;
                }
                else
                {
                    return(RequestHandlingStatus.RequestWasUnhandled);
                }
                break;
            }

            return(RequestHandlingStatus.RequestWasHandled);
        }