internal ServiceProvider(UnityConfigurationOptions options)
 {
     _options = options;
     _options.UnityContainer.RegisterInstance <IServiceScope>(this, new ExternallyControlledLifetimeManager());
     _options.UnityContainer.RegisterInstance <IServiceProvider>(this, new ExternallyControlledLifetimeManager());
     _options.UnityContainer.RegisterInstance <IServiceScopeFactory>(this, new ExternallyControlledLifetimeManager());
 }
Exemple #2
0
        private UnityConfigurationOptions CreateOptions()
        {
            var options = new UnityConfigurationOptions();

            _config(options);
            options.UnityContainer = options.UnityContainer ?? new UnityContainer();
            ConfigureContainer(options.UnityContainer);

            return(options);
        }