Exemple #1
0
        public IHost Build <TStartup>() where TStartup : IStartup, new()
        {
            IStartup startup = new TStartup();

            ConfigureMembers(startup.Members);
            IServiceCollection hostingServices = BuildHostingServices();

            startup.ConfigureServices(hostingServices);
            IServiceProvider hostingContainer = startup.ConfigureServices(hostingServices);

            return(new TinkerHost(hostingServices, hostingContainer, members));
        }
Exemple #2
0
        public ServiceResolverBuilder UseStartup <TStartup>() where TStartup : IServiceResolverStartup, new()
        {
            var startup = new TStartup();

            configurationActions.Add(config => startup.Configure(config));
            configureServicesActions.Add((config, services) => startup.ConfigureServices(config, services));
            return(this);
        }
        public WebHost UseStartup <TStartup>() where TStartup : IStartup, new()
        {
            var startup             = new TStartup();
            var serviceConfigurator = compositionRoot.ServiceConfigurator;

            startup.ConfigureServices(serviceConfigurator);
            requestListener.Configuration = startup.Configuration;
            return(this);
        }