Ejemplo n.º 1
0
        public DiContainer(IServiceScope scope, ContainerOverrides overrides)
        {
            overrides.RegisterInstance(this, new RegistrationOptions().ExternallyOwned().As <IDependencyContainer>().As <IDependencyResolver>());

            _scope     = scope;
            _overrides = overrides;
        }
Ejemplo n.º 2
0
        public IDependencyContainer BeginScope(Action <ContainerConfigurator> configuration = null)
        {
            var overrides = new ContainerOverrides();

            configuration?.Invoke(overrides);

            return(new DiContainer(_scope.ServiceProvider.CreateScope(), overrides));
        }
Ejemplo n.º 3
0
        public IDependencyContainerV2 BeginScope(LifetimeScope scope, Action <ContainerConfigurator> configuration = null)
        {
            var overrides = new ContainerOverrides();

            configuration?.Invoke(overrides);

            return(new DiContainer(_scope.BeginScope(scope), overrides));
        }