Пример #1
0
        /// <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();
            }
        }
 /// <summary>
 ///
 /// </summary>
 /// <param name="context"></param>
 public void EndRequest(object context)
 {
     RequestScopeContext.FreeContextSlot();
 }