Table of Contents

TryConfigure Method

Definition

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

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

Registers the specified setup used to configure TOptions to the services if not already registered.

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

Parameters

services IServiceCollection

The IServiceCollection to add the TOptions to.

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.