Bagikan melalui


WebHostBuilderExtensions.UseStartup Metode

Definisi

Overload

UseStartup(IWebHostBuilder, Type)

Tentukan jenis startup yang akan digunakan oleh host web.

UseStartup<TStartup>(IWebHostBuilder)

Tentukan jenis startup yang akan digunakan oleh host web.

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

Tentukan pabrik yang membuat instans startup yang akan digunakan oleh host web.

UseStartup(IWebHostBuilder, Type)

Sumber:
WebHostBuilderExtensions.cs
Sumber:
WebHostBuilderExtensions.cs
Sumber:
WebHostBuilderExtensions.cs

Tentukan jenis startup yang akan digunakan oleh 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

Parameter

hostBuilder
IWebHostBuilder

untuk IWebHostBuilder mengonfigurasi.

startupType
Type

yang Type akan digunakan.

Mengembalikan

IWebHostBuilder.

Berlaku untuk

UseStartup<TStartup>(IWebHostBuilder)

Sumber:
WebHostBuilderExtensions.cs
Sumber:
WebHostBuilderExtensions.cs
Sumber:
WebHostBuilderExtensions.cs

Tentukan jenis startup yang akan digunakan oleh 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

Jenis parameter

TStartup

Jenis yang berisi metode startup untuk aplikasi.

Parameter

hostBuilder
IWebHostBuilder

untuk IWebHostBuilder mengonfigurasi.

Mengembalikan

IWebHostBuilder.

Berlaku untuk

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

Sumber:
WebHostBuilderExtensions.cs

Tentukan pabrik yang membuat instans startup yang akan digunakan oleh 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

Jenis parameter

TStartup

Parameter

hostBuilder
IWebHostBuilder

untuk IWebHostBuilder mengonfigurasi.

startupFactory
Func<WebHostBuilderContext,TStartup>

Delegasi yang menentukan pabrik untuk kelas startup.

Mengembalikan

IWebHostBuilder.

Keterangan

Saat berada di aplikasi yang dipangkas TStartup , semua metode publik dipertahankan. Ini harus cocok dengan jenis Startup secara langsung (dan bukan jenis dasar).

Berlaku untuk