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)); }
public IDisposable BeginScope <TState>(TState state) => _scopeProvider.Push(state);
public IDisposable BeginScope <TState>(TState state) { return(_scopeProvider.Push(state)); }
/// <inheritdoc /> public IDisposable?BeginScope <TState>(TState state) where TState : notnull { return(_externalScopeProvider?.Push(state)); }
public IDisposable?BeginScope <TState>(TState state) { return(_scopes?.Push(state)); }
public IDisposable BeginScope <TState>(TState state) { return(_scopeProvider != null?_scopeProvider.Push(state) : NullScope.Instance); }
/// <inheritdoc /> public IDisposable BeginScope <TState>(TState state) { return(_externalScopeProvider?.Push(state)); }
public IDisposable BeginScope <TState>(TState state) => _scopeProvider?.Push(state) ?? NullDisposable.Instance;