HostingHostBuilderExtensions.ConfigureServices Méthode

Définition

Ajoute des services au conteneur. Peut être appelée plusieurs fois ; dans ce cas, les résultats sont additifs.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ ConfigureServices(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder, Action<Microsoft::Extensions::DependencyInjection::IServiceCollection ^> ^ configureDelegate);
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

Paramètres

hostBuilder
IHostBuilder

IHostBuilder à configurer.

configureDelegate
Action<IServiceCollection>

Délégué permettant de configurer la IServiceCollection.

Retours

La même instance du IHostBuilder pour le chaînage.

S’applique à