Table of Contents

AddConfiguredOptions Method

Definition

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

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

services IServiceCollection

The IServiceCollection to add the services to.

setup Action<TOptions>

The TOptions which need to be configured by the setup delegate.

Returns

IServiceCollection

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

Type Parameters

TOptions

The options type to be configured.

Exceptions

ArgumentNullException

services cannot be null -or- setup cannot be null.

ArgumentException

setup are not in a valid state.