HostingHostBuilderExtensions.ConfigureServices(IHostBuilder, Action<IServiceCollection>) HostingHostBuilderExtensions.ConfigureServices(IHostBuilder, Action<IServiceCollection>) HostingHostBuilderExtensions.ConfigureServices(IHostBuilder, Action<IServiceCollection>) Method

Definition

Adds services to the container. This can be called multiple times and the results will be additive.

public static Microsoft.Extensions.Hosting.IHostBuilder ConfigureServices (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.DependencyInjection.IServiceCollection> configureDelegate);
static member ConfigureServices : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.DependencyInjection.IServiceCollection> -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function ConfigureServices (hostBuilder As IHostBuilder, configureDelegate As Action(Of IServiceCollection)) As IHostBuilder

Parameters

hostBuilder
IHostBuilder IHostBuilder IHostBuilder

The IHostBuilder to configure.

configureDelegate
Action<IServiceCollection>

Returns

The same instance of the IHostBuilder for chaining.

Applies to