Пример #1
0
        public IDisposable BeginScope(object state)
        {
            if (initializedExternally)
            {
                // BeginScope should never be called if IExternalScopeProvider was created and managed by hosting framework.
                // Just in case, return null if it's called
                return(null);
            }

            //if IExternalScopeProvider wasn't created by hosting framework, instantiate our oun to provide Scope support.
            if (externalScopeProvider == null)
            {
                externalScopeProvider = new LoggerExternalScopeProvider();
            }

            return(externalScopeProvider.Push(state));
        }
Пример #2
0
 public IDisposable BeginScope <TState>(TState state) => _scopeProvider.Push(state);
Пример #3
0
 public IDisposable BeginScope <TState>(TState state)
 {
     return(_scopeProvider.Push(state));
 }
Пример #4
0
 /// <inheritdoc />
 public IDisposable?BeginScope <TState>(TState state) where TState : notnull
 {
     return(_externalScopeProvider?.Push(state));
 }
 public IDisposable?BeginScope <TState>(TState state)
 {
     return(_scopes?.Push(state));
 }
Пример #6
0
 public IDisposable BeginScope <TState>(TState state)
 {
     return(_scopeProvider != null?_scopeProvider.Push(state) : NullScope.Instance);
 }
Пример #7
0
 /// <inheritdoc />
 public IDisposable BeginScope <TState>(TState state)
 {
     return(_externalScopeProvider?.Push(state));
 }
Пример #8
0
 public IDisposable BeginScope <TState>(TState state) => _scopeProvider?.Push(state) ?? NullDisposable.Instance;