Condividi tramite


WebHostBuilderExtensions.UseStartup Metodo

Definizione

Overload

UseStartup(IWebHostBuilder, Type)

Specificare il tipo di avvio da usare dall'host Web.

UseStartup<TStartup>(IWebHostBuilder)

Specificare il tipo di avvio da usare dall'host Web.

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

Specificare una factory che crea l'istanza di avvio da usare dall'host Web.

UseStartup(IWebHostBuilder, Type)

Origine:
WebHostBuilderExtensions.cs
Origine:
WebHostBuilderExtensions.cs
Origine:
WebHostBuilderExtensions.cs

Specificare il tipo di avvio da usare dall'host Web.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ UseStartup(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ hostBuilder, Type ^ startupType);
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder UseStartup (this Microsoft.AspNetCore.Hosting.IWebHostBuilder hostBuilder, Type startupType);
static member UseStartup : Microsoft.AspNetCore.Hosting.IWebHostBuilder * Type -> Microsoft.AspNetCore.Hosting.IWebHostBuilder
<Extension()>
Public Function UseStartup (hostBuilder As IWebHostBuilder, startupType As Type) As IWebHostBuilder

Parametri

hostBuilder
IWebHostBuilder

Oggetto IWebHostBuilder da configurare.

startupType
Type

Struttura Type da utilizzare.

Restituisce

Oggetto IWebHostBuilder.

Si applica a

UseStartup<TStartup>(IWebHostBuilder)

Origine:
WebHostBuilderExtensions.cs
Origine:
WebHostBuilderExtensions.cs
Origine:
WebHostBuilderExtensions.cs

Specificare il tipo di avvio da usare dall'host Web.

public:
generic <typename TStartup>
 where TStartup : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ UseStartup(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ hostBuilder);
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder UseStartup<TStartup> (this Microsoft.AspNetCore.Hosting.IWebHostBuilder hostBuilder) where TStartup : class;
static member UseStartup : Microsoft.AspNetCore.Hosting.IWebHostBuilder -> Microsoft.AspNetCore.Hosting.IWebHostBuilder (requires 'Startup : null)
<Extension()>
Public Function UseStartup(Of TStartup As Class) (hostBuilder As IWebHostBuilder) As IWebHostBuilder

Parametri di tipo

TStartup

Tipo contenente i metodi di avvio per l'applicazione.

Parametri

hostBuilder
IWebHostBuilder

Oggetto IWebHostBuilder da configurare.

Restituisce

Oggetto IWebHostBuilder.

Si applica a

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

Origine:
WebHostBuilderExtensions.cs

Specificare una factory che crea l'istanza di avvio da usare dall'host Web.

public:
generic <typename TStartup>
 where TStartup : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ UseStartup(Microsoft::AspNetCore::Hosting::IWebHostBuilder ^ hostBuilder, Func<Microsoft::AspNetCore::Hosting::WebHostBuilderContext ^, TStartup> ^ startupFactory);
public static Microsoft.AspNetCore.Hosting.IWebHostBuilder UseStartup<TStartup> (this Microsoft.AspNetCore.Hosting.IWebHostBuilder hostBuilder, Func<Microsoft.AspNetCore.Hosting.WebHostBuilderContext,TStartup> startupFactory) where TStartup : class;
static member UseStartup : Microsoft.AspNetCore.Hosting.IWebHostBuilder * Func<Microsoft.AspNetCore.Hosting.WebHostBuilderContext, 'Startup (requires 'Startup : null)> -> Microsoft.AspNetCore.Hosting.IWebHostBuilder (requires 'Startup : null)
<Extension()>
Public Function UseStartup(Of TStartup As Class) (hostBuilder As IWebHostBuilder, startupFactory As Func(Of WebHostBuilderContext, TStartup)) As IWebHostBuilder

Parametri di tipo

TStartup

Parametri

hostBuilder
IWebHostBuilder

Oggetto IWebHostBuilder da configurare.

startupFactory
Func<WebHostBuilderContext,TStartup>

Delegato che specifica una factory per la classe di avvio.

Restituisce

Oggetto IWebHostBuilder.

Commenti

Quando in un'app tagliata, tutti i metodi pubblici di TStartup vengono mantenuti. Deve corrispondere direttamente al tipo di avvio (e non a un tipo di base).

Si applica a