Udostępnij za pośrednictwem


HostBuilder.ConfigureServices Metoda

Definicja

Dodaje usługi do kontenera. Może to być wywoływane wiele razy, a wyniki będą addytywne.

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>

Delegat do konfigurowania IConfigurationBuilder , który będzie używany do konstruowania IConfiguration hosta.

Zwraca

To samo wystąpienie elementu IHostBuilder do tworzenia łańcucha.

Implementuje

Dotyczy