Language

WebApplicationFactoryPoint>.WithWebHostBuilder Method

Definition

Creates a new WebApplicationFactory with a IWebHostBuilder that is further customized by configuration.

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

Parameters

configuration
Action<IWebHostBuilder>

An Action to configure the IWebHostBuilder.

Returns

A new WebApplicationFactory.

Applies to