예제 #1
0
        public IServiceScope CreateScope()
        {
            var provider = new StKServiceProvider(this);
            var scope    = new StKServiceScope(provider);

            provider.ServiceScope = scope;
            return(scope);
        }
예제 #2
0
        public IServiceProvider Build()
        {
            var provider = new StKServiceProvider(this);

            this.serviceProvider = provider;
            this.relations.Add(typeof(IServiceProvider), typeof(StKServiceProvider), ServiceLifetime.Singleton, instance: this.serviceProvider);
            this.relations.Add(typeof(IServiceScope), typeof(StKServiceScope), ServiceLifetime.Scoped);
            this.relations.Add(typeof(IServiceScopeFactory), typeof(StKServiceProvider), ServiceLifetime.Singleton, instance: this.serviceProvider);
            this.relations.Add(typeof(IStKProviderMonitor), typeof(StKObjectCollection), ServiceLifetime.Singleton, instance: provider.ObjectContainer);
            return(this.serviceProvider);
        }
예제 #3
0
 public StKServiceProvider(StKServiceProvider serviceProvider)
 {
     this.serviceCollection = serviceProvider.serviceCollection;
     this.ObjectContainer   = serviceProvider.ObjectContainer;
 }