示例#1
0
        /// <inheritdoc />
        public IScope CreateScope(
            IsolationLevel isolationLevel                      = IsolationLevel.Unspecified,
            RepositoryCacheMode repositoryCacheMode            = RepositoryCacheMode.Unspecified,
            IScopedNotificationPublisher notificationPublisher = null,
            bool?scopeFileSystems = null,
            bool callContext      = false,
            bool autoComplete     = false)
        {
            Scope ambientScope = AmbientScope;

            if (ambientScope == null)
            {
                IScopeContext ambientContext = AmbientContext;
                ScopeContext  newContext     = ambientContext == null ? new ScopeContext() : null;
                var           scope          = new Scope(this, _coreDebugSettings, _eventAggregator, _loggerFactory.CreateLogger <Scope>(), _fileSystems, false, newContext, isolationLevel, repositoryCacheMode, notificationPublisher, scopeFileSystems, callContext, autoComplete);
                // assign only if scope creation did not throw!
                PushAmbientScope(scope);
                if (newContext != null)
                {
                    PushAmbientScopeContext(newContext);
                }
                return(scope);
            }

            var nested = new Scope(this, _coreDebugSettings, _eventAggregator, _loggerFactory.CreateLogger <Scope>(), _fileSystems, ambientScope, isolationLevel, repositoryCacheMode, notificationPublisher, scopeFileSystems, callContext, autoComplete);

            PushAmbientScope(nested);
            return(nested);
        }
示例#2
0
 public IScope CreateScope(
     IsolationLevel isolationLevel                      = IsolationLevel.Unspecified,
     RepositoryCacheMode repositoryCacheMode            = RepositoryCacheMode.Unspecified,
     IScopedNotificationPublisher notificationPublisher = null,
     bool?scopeFileSystems = null,
     bool callContext      = false,
     bool autoComplete     = false) => _scope;
示例#3
0
 /// <inheritdoc />
 public IScope CreateDetachedScope(
     IsolationLevel isolationLevel           = IsolationLevel.Unspecified,
     RepositoryCacheMode repositoryCacheMode = RepositoryCacheMode.Unspecified,
     IEventDispatcher eventDispatcher        = null,
     IScopedNotificationPublisher scopedNotificationPublisher = null,
     bool?scopeFileSystems = null)
 => new Scope(this, _coreDebugSettings, _mediaFileManager, _eventAggregator, _loggerFactory.CreateLogger <Scope>(), _fileSystems, true, null, isolationLevel, repositoryCacheMode, eventDispatcher, scopedNotificationPublisher, scopeFileSystems);
示例#4
0
 public IScope CreateDetachedScope(
     IsolationLevel isolationLevel                      = IsolationLevel.Unspecified,
     RepositoryCacheMode repositoryCacheMode            = RepositoryCacheMode.Unspecified,
     IScopedNotificationPublisher notificationPublisher = null,
     bool?scopeFileSystems = null) => throw new NotImplementedException();