Dela via


ISupportsStartup.UseStartup Method

Definition

Overloads

UseStartup(Type)

Specify the startup type to be used by the web host.

UseStartup<TStartup>(Func<WebHostBuilderContext,TStartup>)

Specify a factory that creates the startup instance to be used by the web host.

UseStartup(Type)

Source:
ISupportsStartup.cs

Specify the startup type to be used by the web host.

public Microsoft.AspNetCore.Hosting.IWebHostBuilder UseStartup (Type startupType);
abstract member UseStartup : Type -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
Public Function UseStartup (startupType As Type) As IWebHostBuilder

Parameters

startupType
Type

The Type to be used.

Returns

The IWebHostBuilder.

Applies to

UseStartup<TStartup>(Func<WebHostBuilderContext,TStartup>)

Source:
ISupportsStartup.cs

Specify a factory that creates the startup instance to be used by the web host.

public Microsoft.AspNetCore.Hosting.IWebHostBuilder UseStartup<TStartup> (Func<Microsoft.AspNetCore.Hosting.WebHostBuilderContext,TStartup> startupFactory);
abstract member UseStartup : Func<Microsoft.AspNetCore.Hosting.WebHostBuilderContext, 'Startup> -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
Public Function UseStartup(Of TStartup) (startupFactory As Func(Of WebHostBuilderContext, TStartup)) As IWebHostBuilder

Type Parameters

TStartup

Parameters

startupFactory
Func<WebHostBuilderContext,TStartup>

A delegate that specifies a factory for the startup class.

Returns

The IWebHostBuilder.

Remarks

When in a trimmed app, all public methods of TStartup are preserved. This should match the Startup type directly (and not a base type).

Applies to