Bagikan melalui


OptionsServiceCollectionExtensions.Configure Metode

Definisi

Overload

Configure<TOptions>(IServiceCollection, Action<TOptions>)

Mendaftarkan tindakan yang digunakan untuk mengonfigurasi jenis opsi tertentu sekali selama startup. Ini dijalankan sebelum PostConfigure<TOptions>(IServiceCollection, Action<TOptions>). Updates ke konfigurasi tidak memanggil tindakan lagi.

Configure<TOptions>(IServiceCollection, String, Action<TOptions>)

Mendaftarkan tindakan yang digunakan untuk mengonfigurasi jenis opsi tertentu. Ini dijalankan sebelum PostConfigure<TOptions>(IServiceCollection, Action<TOptions>).

Configure<TOptions>(IServiceCollection, Action<TOptions>)

Sumber:
OptionsServiceCollectionExtensions.cs
Sumber:
OptionsServiceCollectionExtensions.cs
Sumber:
OptionsServiceCollectionExtensions.cs
Sumber:
OptionsServiceCollectionExtensions.cs
Sumber:
OptionsServiceCollectionExtensions.cs

Mendaftarkan tindakan yang digunakan untuk mengonfigurasi jenis opsi tertentu sekali selama startup. Ini dijalankan sebelum PostConfigure<TOptions>(IServiceCollection, Action<TOptions>). Updates ke konfigurasi tidak memanggil tindakan lagi.

public:
generic <typename TOptions>
 where TOptions : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ Configure(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<TOptions> ^ configureOptions);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection Configure<TOptions> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<TOptions> configureOptions) where TOptions : class;
static member Configure : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<'Options (requires 'Options : null)> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Options : null)
<Extension()>
Public Function Configure(Of TOptions As Class) (services As IServiceCollection, configureOptions As Action(Of TOptions)) As IServiceCollection

Jenis parameter

TOptions

Jenis opsi yang akan dikonfigurasi.

Parameter

services
IServiceCollection

untuk IServiceCollection menambahkan layanan.

configureOptions
Action<TOptions>

Tindakan yang digunakan untuk mengonfigurasi opsi.

Mengembalikan

IServiceCollection Sehingga panggilan tambahan dapat dirangkai.

Berlaku untuk

Configure<TOptions>(IServiceCollection, String, Action<TOptions>)

Sumber:
OptionsServiceCollectionExtensions.cs
Sumber:
OptionsServiceCollectionExtensions.cs
Sumber:
OptionsServiceCollectionExtensions.cs
Sumber:
OptionsServiceCollectionExtensions.cs
Sumber:
OptionsServiceCollectionExtensions.cs

Mendaftarkan tindakan yang digunakan untuk mengonfigurasi jenis opsi tertentu. Ini dijalankan sebelum PostConfigure<TOptions>(IServiceCollection, Action<TOptions>).

public:
generic <typename TOptions>
 where TOptions : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ Configure(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, System::String ^ name, Action<TOptions> ^ configureOptions);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection Configure<TOptions> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string? name, Action<TOptions> configureOptions) where TOptions : class;
static member Configure : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<'Options (requires 'Options : null)> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Options : null)
<Extension()>
Public Function Configure(Of TOptions As Class) (services As IServiceCollection, name As String, configureOptions As Action(Of TOptions)) As IServiceCollection

Jenis parameter

TOptions

Jenis opsi yang akan dikonfigurasi.

Parameter

services
IServiceCollection

untuk IServiceCollection menambahkan layanan.

name
String

Nama instans opsi.

configureOptions
Action<TOptions>

Tindakan yang digunakan untuk mengonfigurasi opsi.

Mengembalikan

IServiceCollection Sehingga panggilan tambahan dapat dirangkai.

Berlaku untuk