public IHost Build()
        {
            var configuration = _configurationBuilder.Build();

            _serviceCollection.AddSingleton <IConfiguration>(configuration);
            return(new WebHost(_serviceCollection.BuildServiceProvider(), _requestPipeline.Build()));
        }
        public IHost Build()
        {
            var configuration = _configurationBuilder.Build();

            _serviceCollection.AddSingleton <IConfiguration>(configuration);
            var serviceProvider = _serviceCollection.BuildServiceProvider();

            _initAction?.Invoke(configuration, serviceProvider);

            return(new WebHost(serviceProvider, _requestPipeline.Build()));
        }