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

            Rollback();
            IsDisposed    = true;
            threadContext = null;
        }
示例#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());
 }
示例#4
0
        private void Dispose(bool byUser)
        {
            if (byUser)
            {
                GC.SuppressFinalize(this);
            }

            Rollback();
            IsDisposed = true;
            threadContext = null;
        }
示例#5
0
 internal static ScarfContext GetThreadContext()
 {
     if (threadContext == null)
     {
         threadContext = new ScarfContext(null);
     }
     return threadContext;
 }