TryConfigure Method
Definition
- Namespace
- Cuemon.Extensions.DependencyInjection
- Assemblies
- Cuemon.Extensions.DependencyInjection.dll
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
servicesIServiceCollectionThe IServiceCollection to add the
TOptionsto.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.