Пример #1
0
        public static IWebHostBuilder UseFactoryFactory
            (this IWebHostBuilder webHostBuilder, Action <ConfigurationOptions> configure = null)
        {
            var options = new ConfigurationOptions();

            configure?.Invoke(options);
            var serviceProviderFactory = new ServiceProviderFactory(options);

            return(webHostBuilder.ConfigureServices(services =>
                                                    services
                                                    .AddSingleton <IServiceProviderFactory <Registry> >(serviceProviderFactory)
                                                    .AddSingleton <IServiceProviderFactory <IServiceCollection> >(serviceProviderFactory)
                                                    ));
        }