อ่านในภาษาอังกฤษ

แชร์ผ่าน


ContextualOptionsServiceCollectionExtensions Class

Definition

Extension methods for adding contextual options services to the DI container.

C#
public static class ContextualOptionsServiceCollectionExtensions
Inheritance
ContextualOptionsServiceCollectionExtensions

Methods

AddContextualOptions(IServiceCollection)

Adds services required for using contextual options.

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

Registers an action used to configure a particular type of options.

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

Registers an action used to configure a particular type of options.

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

Registers an action used to configure a particular type of options.

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

Registers an action used to configure a particular type of options.

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

Registers an action used to configure all instances of a particular type of options.

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

Registers an action used to configure all instances of a particular type of options.

Applies to

ผลิตภัณฑ์ เวอร์ชัน
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)