共用方式為


ContextualOptionsServiceCollectionExtensions.Configure 方法

定義

多載

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

註冊用來設定特定選項類型的動作。

Configure<TOptions>(IServiceCollection, Func<IOptionsContext,CancellationToken,ValueTask<IConfigureContextualOptions<TOptions>>>)

註冊用來設定特定選項類型的動作。

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

註冊用來設定特定選項類型的動作。

Configure<TOptions>(IServiceCollection, String, Func<IOptionsContext,CancellationToken,ValueTask<IConfigureContextualOptions<TOptions>>>)

註冊用來設定特定選項類型的動作。

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

來源:
ContextualOptionsServiceCollectionExtensions.cs

註冊用來設定特定選項類型的動作。

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

類型參數

TOptions

要設定的選項類型。

參數

services
IServiceCollection

要新增服務的 IServiceCollection

configure
Action<IOptionsContext,TOptions>

用來設定選項的動作。

傳回

services 的值。

適用於

Configure<TOptions>(IServiceCollection, Func<IOptionsContext,CancellationToken,ValueTask<IConfigureContextualOptions<TOptions>>>)

來源:
ContextualOptionsServiceCollectionExtensions.cs

註冊用來設定特定選項類型的動作。

public:
generic <typename TOptions>
 where TOptions : class[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ Configure(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Func<Microsoft::Extensions::Options::Contextual::IOptionsContext ^, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask<Microsoft::Extensions::Options::Contextual::Provider::IConfigureContextualOptions<TOptions> ^>> ^ loadOptions);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection Configure<TOptions> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Func<Microsoft.Extensions.Options.Contextual.IOptionsContext,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<Microsoft.Extensions.Options.Contextual.Provider.IConfigureContextualOptions<TOptions>>> loadOptions) where TOptions : class;
static member Configure : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<Microsoft.Extensions.Options.Contextual.IOptionsContext, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<Microsoft.Extensions.Options.Contextual.Provider.IConfigureContextualOptions<'Options>>> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Options : null)
<Extension()>
Public Function Configure(Of TOptions As Class) (services As IServiceCollection, loadOptions As Func(Of IOptionsContext, CancellationToken, ValueTask(Of IConfigureContextualOptions(Of TOptions)))) As IServiceCollection

類型參數

TOptions

要設定的選項類型。

參數

services
IServiceCollection

要新增服務的 IServiceCollection

loadOptions
Func<IOptionsContext,CancellationToken,ValueTask<IConfigureContextualOptions<TOptions>>>

用來設定選項的動作。

傳回

services 的值。

適用於

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

來源:
ContextualOptionsServiceCollectionExtensions.cs

註冊用來設定特定選項類型的動作。

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<Microsoft::Extensions::Options::Contextual::IOptionsContext ^, TOptions> ^ configure);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection Configure<TOptions> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string? name, Action<Microsoft.Extensions.Options.Contextual.IOptionsContext,TOptions> configure) where TOptions : class;
static member Configure : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Action<Microsoft.Extensions.Options.Contextual.IOptionsContext, '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, configure As Action(Of IOptionsContext, TOptions)) As IServiceCollection

類型參數

TOptions

要設定的選項類型。

參數

services
IServiceCollection

要新增服務的 IServiceCollection

name
String

要設定的選項名稱。

configure
Action<IOptionsContext,TOptions>

用來設定選項的動作。

傳回

services 的值。

適用於

Configure<TOptions>(IServiceCollection, String, Func<IOptionsContext,CancellationToken,ValueTask<IConfigureContextualOptions<TOptions>>>)

來源:
ContextualOptionsServiceCollectionExtensions.cs

註冊用來設定特定選項類型的動作。

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, Func<Microsoft::Extensions::Options::Contextual::IOptionsContext ^, System::Threading::CancellationToken, System::Threading::Tasks::ValueTask<Microsoft::Extensions::Options::Contextual::Provider::IConfigureContextualOptions<TOptions> ^>> ^ loadOptions);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection Configure<TOptions> (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, string? name, Func<Microsoft.Extensions.Options.Contextual.IOptionsContext,System.Threading.CancellationToken,System.Threading.Tasks.ValueTask<Microsoft.Extensions.Options.Contextual.Provider.IConfigureContextualOptions<TOptions>>> loadOptions) where TOptions : class;
static member Configure : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Func<Microsoft.Extensions.Options.Contextual.IOptionsContext, System.Threading.CancellationToken, System.Threading.Tasks.ValueTask<Microsoft.Extensions.Options.Contextual.Provider.IConfigureContextualOptions<'Options>>> -> Microsoft.Extensions.DependencyInjection.IServiceCollection (requires 'Options : null)
<Extension()>
Public Function Configure(Of TOptions As Class) (services As IServiceCollection, name As String, loadOptions As Func(Of IOptionsContext, CancellationToken, ValueTask(Of IConfigureContextualOptions(Of TOptions)))) As IServiceCollection

類型參數

TOptions

要設定的選項類型。

參數

services
IServiceCollection

要新增服務的 IServiceCollection

name
String

要設定的選項名稱。

loadOptions
Func<IOptionsContext,CancellationToken,ValueTask<IConfigureContextualOptions<TOptions>>>

用來設定選項的動作。

傳回

services 的值。

適用於