Bagikan melalui


IHostBuilder.ConfigureServices Metode

Definisi

Menambahkan layanan ke kontainer. Ini dapat dipanggil beberapa kali dan hasilnya akan menjadi aditif.

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

Parameter

configureDelegate
Action<HostBuilderContext,IServiceCollection>

Delegasi untuk mengonfigurasi IServiceCollection yang akan digunakan untuk membangun IServiceProvider.

Mengembalikan

Instans yang sama untuk penautan IHostBuilder .

Berlaku untuk