FakeHostingExtensions.Configure Method

Definition

Exposes IHostBuilder for changes via a delegate.

C#
public static Microsoft.Extensions.Hosting.IHostBuilder Configure (this Microsoft.Extensions.Hosting.IHostBuilder builder, Action<Microsoft.Extensions.Hosting.IHostBuilder> configure);

Parameters

builder
IHostBuilder

An IHostBuilder instance.

configure
Action<IHostBuilder>

Configures the IHostBuilder instance.

Returns

The IHostBuilder instance.

Remarks

Designed to ease host configuration in unit tests by defining common configuration methods.

Applies to

Produkt Versjoner
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)