Exemple #1
0
        public async Task Invoke(HttpContext context)
        {
            // Do something with context near the beginning of request processing.
            if (context.Request.Path.Value.EndsWith("upload.axd"))
            {
                var temporaryStorage = new TemporaryStorage();
                var result           = temporaryStorage.ProcessRequest(context);

                HttpHelpers.SendJson(context.Response, result);

                return;
            }

            await _next.Invoke(context);

            // Clean up.
        }
        public async Task Invoke(HttpContext context)
        {
            // Do something with context near the beginning of request processing.
            if (context.Request.Path.Value.EndsWith("upload.axd"))
            {
                //using (var scope = IoCGlobal.NewScope())
                //{
                //    var temporaryStorage = IoCGlobal.Resolve<TemporaryStorage>();

                var temporaryStorage = new TemporaryStorage();
                temporaryStorage.ProcessRequest(context);


                return;
                //}
            }

            await _next.Invoke(context);

            // Clean up.
        }