英語で読む

次の方法で共有


ContextualOptionsServiceCollectionExtensions クラス

定義

DI コンテナーにコンテキスト オプション サービスを追加するための拡張メソッド。

C#
public static class ContextualOptionsServiceCollectionExtensions
継承
ContextualOptionsServiceCollectionExtensions

メソッド

AddContextualOptions(IServiceCollection)

コンテキスト オプションを使用するために必要なサービスを追加します。

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>>>)

特定の型のオプションを構成するために使用されるアクションを登録します。

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

特定の型のオプションのすべてのインスタンスを構成するために使用されるアクションを登録します。

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

特定の型のオプションのすべてのインスタンスを構成するために使用されるアクションを登録します。

適用対象

製品 バージョン
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)