protected NetCoreScope(NetCoreScope parent) { _parent = parent; _scopeCache = new ScopeCache(); Nesting = (parent?.Nesting ?? 0) + 1; _rootScope = _parent?.RootScope; }
protected ExtensionContainerScope(ExtensionContainerScope parent) { scopeCache = new ScopeCache(); if (parent == null) { this.parent = ExtensionContainerRootScope.RootScope; } else { this.parent = parent; } }
/// <inheritdoc /> public void Dispose() { lock (@lock) { if (scopeCache == null) { return; } if (scopeCache is IDisposable disposableCache) { disposableCache.Dispose(); } scopeCache = null; } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { lock (_lock) { if (_scopeCache == null) { return; } var disposableCache = _scopeCache as IDisposable; if (disposableCache != null) { disposableCache.Dispose(); } _scopeCache = null; } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { lock (_lock) { if (_scopeCache == null) { return; } var disposableCache = _scopeCache as IDisposable; if (disposableCache != null) { disposableCache.Dispose(); } _scopeCache = null; } }
/// <inheritdoc /> public ThreadSafeDefaultLifetimeScope(IScopeCache scopeCache = null, Action <Burden> onAfterCreated = null) { this.scopeCache = scopeCache ?? new ScopeCache(); this.onAfterCreated = onAfterCreated ?? emptyOnAfterCreated; }
public DefaultLifetimeScope(IScopeCache scopeCache = null, Action<Burden> onAfterCreated = null) { this.scopeCache = scopeCache ?? new ScopeCache(); this.onAfterCreated = onAfterCreated ?? emptyOnAfterCreated; }
protected ExtensionContainerScopeBase() { scopeCache = new ScopeCache(); }
/// <summary> /// Initializes a new instance of the <see cref="MessageLifetimeScope"/> class. /// </summary> /// <param name="scopeCache">The scope cache.</param> /// <param name="onAfterCreated">The on after created.</param> public MessageLifetimeScope(IScopeCache scopeCache = null, Action <Burden> onAfterCreated = null) { _scopeCache = scopeCache ?? new ScopeCache(); _onAfterCreated = onAfterCreated ?? EmptyOnAfterCreated; }
/// <summary> /// Initializes a new instance of the <see cref="MessageLifetimeScope"/> class. /// </summary> /// <param name="scopeCache">The scope cache.</param> /// <param name="onAfterCreated">The on after created.</param> public MessageLifetimeScope(IScopeCache scopeCache = null, Action<Burden> onAfterCreated = null) { _scopeCache = scopeCache ?? new ScopeCache(); _onAfterCreated = onAfterCreated ?? EmptyOnAfterCreated; }