Udostępnij za pośrednictwem


HostingHostBuilderExtensions.ConfigureServices Metoda

Definicja

Dodaje usługi do kontenera. Może to być wywoływane wiele razy, a wyniki będą addytywne.

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

Parametry

hostBuilder
IHostBuilder

Element do skonfigurowania IHostBuilder .

configureDelegate
Action<IServiceCollection>

Delegat do konfigurowania .IServiceCollection

Zwraca

To samo wystąpienie elementu IHostBuilder do tworzenia łańcucha.

Dotyczy