WebApplicationFactory<TEntryPoint>.WithWebHostBuilder 方法

定义

使用 进一步自定义configuration的 创建一个新的 。WebApplicationFactory<TEntryPoint>IWebHostBuilder

public:
 Microsoft::AspNetCore::Mvc::Testing::WebApplicationFactory<TEntryPoint> ^ WithWebHostBuilder(Action<Microsoft::AspNetCore::Hosting::IWebHostBuilder ^> ^ configuration);
public Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory<TEntryPoint> WithWebHostBuilder (Action<Microsoft.AspNetCore.Hosting.IWebHostBuilder> configuration);
member this.WithWebHostBuilder : Action<Microsoft.AspNetCore.Hosting.IWebHostBuilder> -> Microsoft.AspNetCore.Mvc.Testing.WebApplicationFactory<'EntryPoint (requires 'EntryPoint : null)>
Public Function WithWebHostBuilder (configuration As Action(Of IWebHostBuilder)) As WebApplicationFactory(Of TEntryPoint)

参数

configuration
Action<IWebHostBuilder>

用于配置 IWebHostBuilderAction<T>

返回

一个新的 WebApplicationFactory<TEntryPoint>

适用于