protected NetCoreScope(NetCoreScope parent) { _parent = parent; _scopeCache = new ScopeCache(); Nesting = (parent?.Nesting ?? 0) + 1; _rootScope = _parent?.RootScope; }
public static NetCoreScope BeginScope(NetCoreScope parent) { var scope = new NetCoreScope(parent); _current.Value = scope; return(scope); }
public IServiceScope CreateScope() { var scope = NetCoreScope.BeginScope(NetCoreScope.Current); //since WindsorServiceProvider is scoped, this gives us new instance var provider = _container.Resolve <IServiceProvider>(); return(new NetCoreServiceScope(scope, provider)); }
public ForcedScope(NetCoreScope scope) { _previousScope = NetCoreScope.Current; NetCoreScope._current.Value = scope; }
public WindsorScopedServiceProvider(IWindsorContainer container) { Container = container; _scope = NetCoreScope.Current; }