ContextualOptionsServiceCollectionExtensions.ConfigureAll Method

Definition

Overloads

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.

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

Source:
ContextualOptionsServiceCollectionExtensions.cs

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

C#
public static Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureAll<TOptions>(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Options.Contextual.IOptionsContext,TOptions> configure) where TOptions : class;

Type Parameters

TOptions

The options type to be configured.

Parameters

services
IServiceCollection

The IServiceCollection to add the services to.

configure
Action<IOptionsContext,TOptions>

The action used to configure the options.

Returns

The value of services.

Applies to

.NET 10 (package-provided) an aner Versiounen
Produkt Versiounen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)

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

Source:
ContextualOptionsServiceCollectionExtensions.cs

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

C#
public static Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureAll<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;

Type Parameters

TOptions

The options type to be configured.

Parameters

services
IServiceCollection

The IServiceCollection to add the services to.

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

The action used to configure the options.

Returns

The value of services.

Applies to

.NET 10 (package-provided) an aner Versiounen
Produkt Versiounen
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)