public async Task Invoke(IDictionary<string, object> environment)
        {
            var scopeContext = new OwinRequestScopeContext(environment, threadSafeItem);
            OwinRequestScopeContext.Current = scopeContext;

            try
            {
                await next(environment);
            }
            finally
            {
                try
                {
                    scopeContext.Complete();
                }
                finally
                {
                    OwinRequestScopeContext.FreeContextSlot();
                }
            }
        }
Exemple #2
0
        public async Task Invoke(IDictionary <string, object> environment)
        {
            var scopeContext = new OwinRequestScopeContext(environment, threadSafeItem);

            OwinRequestScopeContext.Current = scopeContext;

            try
            {
                await next(environment);
            }
            finally
            {
                try
                {
                    scopeContext.Complete();
                }
                finally
                {
                    OwinRequestScopeContext.FreeContextSlot();
                }
            }
        }