Exemple #1
0
            public DeferredHostBuilder(Configuration configuration, Action <IHostBuilder> configureHost, WebHostEnvironment environment, IServiceCollection services)
            {
                _configuration = configuration;
                _environment   = environment;
                _services      = services;

                configureHost(this);
            }
        internal ConfigureWebHostBuilder(ConfigurationManager configuration, WebHostEnvironment environment, IServiceCollection services)
        {
            _configuration = configuration;
            _environment   = environment;
            _services      = services;

            _context = new WebHostBuilderContext
            {
                Configuration      = _configuration,
                HostingEnvironment = _environment
            };
        }
Exemple #3
0
        public WebApplicationHostBuilder(IHostBuilder hostBuilder)
        {
            _hostBuilder = hostBuilder;

            Services = new ServiceCollection();

            // HACK: MVC and Identity do this horrible thing to get the hosting environment as an instance
            // from the service collection before it is built. That needs to be fixed...
            Environment = new WebHostEnvironment();
            Services.AddSingleton(Environment);

            // REVIEW: Since the configuration base is tied to the content root, it needs to be specified as part of
            // builder creation. It's not changing in the current design.
            Configuration     = new ConfigurationBuilder().SetBasePath(Environment.ContentRootPath);
            HostConfiguration = new ConfigurationBuilder().SetBasePath(Environment.ContentRootPath);
            Logging           = new LoggingBuilder(Services);
        }
        internal WebApplicationBuilder(Assembly callingAssembly, Action <IHostBuilder> configureHost)
        {
            Services = new ServiceCollection();

            // HACK: MVC and Identity do this horrible thing to get the hosting environment as an instance
            // from the service collection before it is built. That needs to be fixed...
            var environment = new WebHostEnvironment(callingAssembly);

            Environment = environment;
            Services.AddSingleton(Environment);

            Configuration = new Configuration();

            // Run this inline to populate the configuration
            configureHost(new ConfigurationHostBuilder(Configuration, Environment));

            Configuration.SetBasePath(environment.ContentRootPath);
            Logging = new LoggingBuilder(Services);
            Server  = _deferredWebHostBuilder = new DeferredWebHostBuilder(Configuration, environment);
            Host    = _deferredHostBuilder = new DeferredHostBuilder(Configuration, configureHost, environment);
        }
 public DeferredWebHostBuilder(Configuration configuration, WebHostEnvironment environment)
 {
     _configuration = configuration;
     _environment   = environment;
 }
 public DeferredHostBuilder(Configuration configuration, Action <IHostBuilder> configureHost, WebHostEnvironment environment)
 {
     _configuration = configuration;
     _environment   = environment;
     _operations   += configureHost;
 }
Exemple #7
0
 public DeferredWebHostBuilder(Configuration configuration, WebHostEnvironment environment, IServiceCollection services)
 {
     _configuration = configuration;
     _environment   = environment;
     _services      = services;
 }
 internal ConfigureHostBuilder(Configuration configuration, WebHostEnvironment environment, IServiceCollection services)
 {
     _configuration = configuration;
     _environment   = environment;
     _services      = services;
 }