Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AsyncLocal{T}"/> class.
        /// </summary>
        public AsyncLocal()
        {
#if ASYNCLOCAL
            this.asyncLocal = new System.Threading.AsyncLocal <T>();
#else
            if (LightUps <T> .IsAsyncLocalSupported)
            {
                this.asyncLocal = new AsyncLocal46();
            }
            else
            {
#if CALLCONTEXT
                this.asyncLocal = new AsyncLocalCallContext();
#else
                throw new NotSupportedException();
#endif
            }
#endif
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AsyncLocal{T}"/> class.
 /// </summary>
 public AsyncLocal()
 {
     this.asyncLocal = new System.Threading.AsyncLocal <T>();
 }
Esempio n. 3
0
 private static void SetCurrentTest(HttpTest test) => _test = test;