/// <summary> /// /// </summary> /// <param name="context"></param> public void BeginRequest(object context) { var environment = System.Web.HttpContext.Current.Request.ServerVariables; var scopeContext = new RequestScopeContext(environment); RequestScopeContext.InitCurrent(scopeContext); }
/// <summary> /// /// </summary> /// <param name="environment"></param> /// <returns></returns> public async Task Invoke(IDictionary <string, object> environment) { var scopeContext = new RequestScopeContext(environment); RequestScopeContext.InitCurrent(scopeContext); try { await next(environment); } finally { RequestScopeContext.FreeContextSlot(); } }