Sdílet prostřednictvím


HostBuilder.ConfigureServices Metoda

Definice

Přidá do kontejneru služby. To může být volána vícekrát a výsledky budou sčítat.

public:
 virtual Microsoft::Extensions::Hosting::IHostBuilder ^ ConfigureServices(Action<Microsoft::Extensions::Hosting::HostBuilderContext ^, Microsoft::Extensions::DependencyInjection::IServiceCollection ^> ^ configureDelegate);
public Microsoft.Extensions.Hosting.IHostBuilder ConfigureServices (Action<Microsoft.Extensions.Hosting.HostBuilderContext,Microsoft.Extensions.DependencyInjection.IServiceCollection> configureDelegate);
abstract member ConfigureServices : Action<Microsoft.Extensions.Hosting.HostBuilderContext, Microsoft.Extensions.DependencyInjection.IServiceCollection> -> Microsoft.Extensions.Hosting.IHostBuilder
override this.ConfigureServices : Action<Microsoft.Extensions.Hosting.HostBuilderContext, Microsoft.Extensions.DependencyInjection.IServiceCollection> -> Microsoft.Extensions.Hosting.IHostBuilder
Public Function ConfigureServices (configureDelegate As Action(Of HostBuilderContext, IServiceCollection)) As IHostBuilder

Parametry

configureDelegate
Action<HostBuilderContext,IServiceCollection>

Delegát pro konfiguraci IConfigurationBuilder , který se použije k vytvoření IConfiguration pro hostitele.

Návraty

Stejná instance IHostBuilder pro řetězení.

Implementuje

Platí pro