예제 #1
0
 private ExecutionContextStorage GetCurrentContextInternal()
 {
     if (IsDisposed)
     {
         return(ExecutionContextStorage.GetEmptyContext());
     }
     return(_noFlowContext.Value ?? _executionContextStore.Value);
 }
예제 #2
0
        public Guid SetAndGetContextElement(Guid contextTypeGuid, Guid contextElement)
        {
            if (IsDisposed)
            {
                return(Guid.Empty);
            }
            var storage1 = GetCurrentContextInternal() ?? ExecutionContextStorage.GetEmptyContext();
            var storage2 = storage1.UpdateElement(contextTypeGuid, contextElement, out var previeousValue);

            _executionContextStore.Value = storage2.IsEmpty ? null : storage2;
            _noFlowContext.Value         = null;
            return(previeousValue);
        }