Skip to content

IWebApplicationFactoryExtensions

NexusLabs.Needlr.AspNet

IWebApplicationFactoryExtensions Class

Extension methods for IWebApplicationFactory providing convenient overloads for creating web applications.

public static class IWebApplicationFactoryExtensions

Inheritance System.Object 🡒 IWebApplicationFactoryExtensions

Methods

IWebApplicationFactoryExtensions.Create(this IWebApplicationFactory, CreateWebApplicationOptions) Method

Creates a web application using the specified options with default configuration.

public static Microsoft.AspNetCore.Builder.WebApplication Create(this NexusLabs.Needlr.AspNet.IWebApplicationFactory factory, NexusLabs.Needlr.AspNet.CreateWebApplicationOptions options);

Parameters

factory IWebApplicationFactory

The web application factory.

options CreateWebApplicationOptions

The options for creating the web application.

Returns

Microsoft.AspNetCore.Builder.WebApplication
A configured Microsoft.AspNetCore.Builder.WebApplication.

IWebApplicationFactoryExtensions.Create(this IWebApplicationFactory, CreateWebApplicationOptions, Action<WebApplicationBuilder,CreateWebApplicationOptions>) Method

Creates a web application using the specified options and a configuration callback.

public static Microsoft.AspNetCore.Builder.WebApplication Create(this NexusLabs.Needlr.AspNet.IWebApplicationFactory factory, NexusLabs.Needlr.AspNet.CreateWebApplicationOptions options, System.Action<Microsoft.AspNetCore.Builder.WebApplicationBuilder,NexusLabs.Needlr.AspNet.CreateWebApplicationOptions>? configureCallback);

Parameters

factory IWebApplicationFactory

The web application factory.

options CreateWebApplicationOptions

The options for creating the web application.

configureCallback System.Action<Microsoft.AspNetCore.Builder.WebApplicationBuilder,CreateWebApplicationOptions>

Optional callback to configure the web application builder.

Returns

Microsoft.AspNetCore.Builder.WebApplication
A configured Microsoft.AspNetCore.Builder.WebApplication.