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(); } } }
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(); } } }