Partilhar via


IHostBuilder.ConfigureServices Método

Definição

Adiciona serviços ao contêiner. Isso pode ser chamado várias vezes e os resultados serão aditivos.

public:
 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
Public Function ConfigureServices (configureDelegate As Action(Of HostBuilderContext, IServiceCollection)) As IHostBuilder

Parâmetros

configureDelegate
Action<HostBuilderContext,IServiceCollection>

O delegado para configurar o IServiceCollection que será usado para construir o IServiceProvider.

Retornos

A mesma instância do IHostBuilder para encadeamento.

Aplica-se a