共用方式為


WebHostBuilderExtensions.ConfigureTestServices 方法

定義

使用 中 servicesConfiguration 所提供的服務來設定 IWebHostBuilder 實例。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ ConfigureTestServices(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ webHostBuilder, Action<Microsoft::Extensions::DependencyInjection::IServiceCollection ^> ^ servicesConfiguration);
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder ConfigureTestServices (this Microsoft.AspNetCore.Hosting.IWebHostBuilder webHostBuilder, Action<Microsoft.Extensions.DependencyInjection.IServiceCollection> servicesConfiguration);
static member ConfigureTestServices : Microsoft.AspNetCore.Hosting.IWebHostBuilder * Action<Microsoft.Extensions.DependencyInjection.IServiceCollection> -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
<Extension()>
Public Function ConfigureTestServices (webHostBuilder As IWebHostBuilder, servicesConfiguration As Action(Of IServiceCollection)) As IWebHostBuilder

參數

webHostBuilder
IWebHostBuilder

IWebHostBuilder

servicesConfiguration
Action<IServiceCollection>

Action 將服務註冊到 IServiceCollection

傳回

IWebHostBuilder

適用於