WebApplicationFactory<TEntryPoint>.WithWebHostBuilder Methode

Definition

Erstellt ein neues WebApplicationFactory<TEntryPoint> mit einem IWebHostBuilder , das von configurationweiter angepasst wird.

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)

Parameter

configuration
Action<IWebHostBuilder>

Eine Action<T> zum Konfigurieren von IWebHostBuilder.

Gibt zurück

Ein neuer WebApplicationFactory<TEntryPoint>.

Gilt für: