Compartir a través de


WebHostBuilderExtensions.UseStartup Método

Definición

Sobrecargas

UseStartup(IWebHostBuilder, Type)

Especifique el tipo de inicio que va a usar el host web.

UseStartup<TStartup>(IWebHostBuilder)

Especifique el tipo de inicio que va a usar el host web.

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

Especifique un generador que cree la instancia de inicio que usará el host web.

UseStartup(IWebHostBuilder, Type)

Source:
WebHostBuilderExtensions.cs
Source:
WebHostBuilderExtensions.cs
Source:
WebHostBuilderExtensions.cs

Especifique el tipo de inicio que va a usar el 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

Parámetros

hostBuilder
IWebHostBuilder

El objeto IWebHostBuilder que se va a configurar.

startupType
Type

Type que se va a utilizar.

Devoluciones

IWebHostBuilder.

Se aplica a

UseStartup<TStartup>(IWebHostBuilder)

Source:
WebHostBuilderExtensions.cs
Source:
WebHostBuilderExtensions.cs
Source:
WebHostBuilderExtensions.cs

Especifique el tipo de inicio que va a usar el 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

Parámetros de tipo

TStartup

Tipo que contiene los métodos de inicio de la aplicación.

Parámetros

hostBuilder
IWebHostBuilder

El objeto IWebHostBuilder que se va a configurar.

Devoluciones

IWebHostBuilder.

Se aplica a

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

Source:
WebHostBuilderExtensions.cs

Especifique un generador que cree la instancia de inicio que usará el 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

Parámetros de tipo

TStartup

Parámetros

hostBuilder
IWebHostBuilder

El objeto IWebHostBuilder que se va a configurar.

startupFactory
Func<WebHostBuilderContext,TStartup>

Delegado que especifica un generador para la clase de inicio.

Devoluciones

IWebHostBuilder.

Comentarios

Cuando se encuentra en una aplicación recortada, se conservan todos los métodos públicos de TStartup . Esto debe coincidir directamente con el tipo de inicio (y no un tipo base).

Se aplica a