PostConfigureAllOf Method
Definition
- Namespace
- Cuemon.Extensions.DependencyInjection
- Assemblies
- Cuemon.Extensions.DependencyInjection.dll
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
servicesIServiceCollectionThe IServiceCollection to extend.
setupAction<TOptions>The
TOptionswhich need to be configured.
Returns
- IServiceCollection
A reference to
servicesso that additional configuration calls can be chained.
Type Parameters
TOptionsThe 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.