AddConfiguredOptions Method
Definition
- Namespace
- Savvyio.Extensions.DependencyInjection
- Assemblies
- Savvyio.Extensions.DependencyInjection.dll
AddConfiguredOptions<TOptions>(IServiceCollection, Action<TOptions>)
Registers the specified setup as a triple-configuration for both compatibility with (and outside the confines of) Microsoft Dependency Injection e.g., IOptions<TOptions>, Action<TOptions> and TOptions.
public static IServiceCollection AddConfiguredOptions<TOptions>(this IServiceCollection services, Action<TOptions> setup) where TOptions : class, IParameterObject, new()
Parameters
servicesIServiceCollectionThe IServiceCollection to add the services to.
setupAction<TOptions>The
TOptionswhich need to be configured by thesetupdelegate.
Returns
- IServiceCollection
A reference to
servicesso that additional calls can be chained.
Type Parameters
TOptionsThe options type to be configured.
Exceptions
- ArgumentNullException
servicescannot be null -or-setupcannot be null.- ArgumentException
setupare not in a valid state.