Esempio n. 1
0
 internal static ScarfContext GetThreadContext()
 {
     if (threadContext == null)
     {
         threadContext = new ScarfContext(null);
     }
     return(threadContext);
 }
Esempio n. 2
0
        private void Dispose(bool byUser)
        {
            if (byUser)
            {
                GC.SuppressFinalize(this);
            }

            Rollback();
            IsDisposed    = true;
            threadContext = null;
        }
Esempio n. 3
0
 public static IScarfContext BeginInlineContext(HttpContextBase httpContext = null)
 {
     if (httpContext != null)
     {
         return(ScarfContext.GetCurrent(httpContext));
     }
     if (ScarfContext.HasThreadContext)
     {
         throw new InvalidOperationException("Cannot have multiple inline contexts on the same thread!");
     }
     return(ScarfContext.GetThreadContext());
 }
Esempio n. 4
0
        private void Dispose(bool byUser)
        {
            if (byUser)
            {
                GC.SuppressFinalize(this);
            }

            Rollback();
            IsDisposed = true;
            threadContext = null;
        }
Esempio n. 5
0
 internal static ScarfContext GetThreadContext()
 {
     if (threadContext == null)
     {
         threadContext = new ScarfContext(null);
     }
     return threadContext;
 }