Compartir a través de


IHostBuilder.ConfigureServices Método

Definición

Agrega servicios al contenedor. Esto se puede llamar varias veces y los resultados serán acumulables.

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>

El delegado para configurar el objeto IServiceCollection que se usará para construir la instancia de IServiceProvider.

Devoluciones

La misma instancia de IHostBuilder para el encadenamiento.

Se aplica a