Compartir a través de


HostBuilder.ConfigureServices Método

Definición

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

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

Parámetros

configureDelegate
Action<HostBuilderContext,IServiceCollection>

El delegado para configurar el objeto IConfigurationBuilder que se usará para construir la instancia de IConfiguration para el host.

Devoluciones

La misma instancia de IHostBuilder para el encadenamiento.

Implementaciones

Se aplica a