Bagikan melalui


OptionsServiceCollectionExtensions.Configure Metode

Definisi

Overload

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

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

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

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

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

Sumber:
OptionsServiceCollectionExtensions.cs
Sumber:
OptionsServiceCollectionExtensions.cs

Mendaftarkan tindakan yang digunakan untuk mengonfigurasi jenis opsi tertentu. Catatan: Ini dijalankan sebelum semua 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, 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

IServiceCollection untuk 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

Mendaftarkan tindakan yang digunakan untuk mengonfigurasi jenis opsi tertentu. Catatan: Ini dijalankan sebelum semua 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

IServiceCollection untuk 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