Esempio n. 1
0
        public static void EndProcessRequest(Task <Tuple <NancyContext, HttpContextBase> > task)
        {
            if (task.IsFaulted)
            {
                var exception = task.Exception;
                exception.Handle(ex => ex is HttpException);
            }

            var nancyContext = task.Result.Item1;
            var httpContext  = task.Result.Item2;

            NancyHandler.SetNancyResponseToHttpResponse(httpContext, nancyContext.Response);
            nancyContext.Dispose();
        }
        public void EndProcessRequest(IAsyncResult result)
        {
            var task = (Task <Tuple <NancyContext, HttpContextBase> >)result;

            if (task.IsFaulted)
            {
                var exception = task.Exception;
                exception.Handle(ex => ex is HttpException);
            }

            var nancyContext = task.Result.Item1;
            var httpContext  = task.Result.Item2;

            NancyHandler.SetNancyResponseToHttpResponse(httpContext, nancyContext.Response);
        }