Table of Contents

PostConfigureAllOf Method

Definition

Namespace
Cuemon.Extensions.DependencyInjection
Assemblies
Cuemon.Extensions.DependencyInjection.dll
Source
src/Cuemon.Extensions.DependencyInjection/ServiceCollectionExtensions.cs

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

Registers an action used to post-configure all instances of a specific TOptions type in the services collection. These are run after Configure<TOptions>(IServiceCollection, Action<TOptions>).

public static IServiceCollection PostConfigureAllOf<TOptions>(this IServiceCollection services, Action<TOptions> setup) where TOptions : class

Parameters

services IServiceCollection

The IServiceCollection to extend.

setup Action<TOptions>

The TOptions which need to be configured.

Returns

IServiceCollection

A reference to services so that additional configuration calls can be chained.

Type Parameters

TOptions

The options type to be configured.

Remarks

Iterates over all the services in the collection, and if the service is of type IConfigureOptions<TOptions> and its generic type argument matches the specified TOptions type, it creates a new instance of PostConfigureOptions<TOptions> for that service and adds it to the services collection.