1
[MemberNotNull(nameof(_appServices))] private void InitializeServiceProvider() { var services = new ServiceCollection(); PopulateServiceCollection( services, _hostBuilderContext!, _hostingEnvironment!, _defaultProvider!, _appConfiguration!, () => _appServices!); foreach (Action<HostBuilderContext, IServiceCollection> configureServicesAction in _configureServicesActions) { configureServicesAction(_hostBuilderContext!, services); } object containerBuilder = _serviceProviderFactory.CreateBuilder(services); foreach (IConfigureContainerAdapter containerAction in _configureContainerActions) { containerAction.ConfigureContainer(_hostBuilderContext!, containerBuilder); } _appServices = _serviceProviderFactory.CreateServiceProvider(containerBuilder); }
标签:core,appServices,web,ServiceProvider,serviceProviderFactory,containerAction,serv From: https://www.cnblogs.com/hitx/p/18370437