Table of Contents

Class ServiceCollectionExtensions

Namespace
OpenSettings.Extensions
Assembly
OpenSettings.dll

Provides extension methods to configure and add OpenSettings services to an IServiceCollection.

public static class ServiceCollectionExtensions
Inheritance
ServiceCollectionExtensions
Inherited Members

Methods

ConfigureOpenSettings(IServiceCollection, IConfiguration)

Configures OpenSettings for the application by iterating over the OpenSettings.OpenSettingsDefaults.Caches.FullNameToLocalSetting and registering each setting type in the IServiceCollection based on the configuration.

This method is typically called during the UseOpenSettingsAsync(IHostBuilder, OpenSettingsConfiguration, params Type[]) extension to initialize OpenSettings configuration.

public static IServiceCollection ConfigureOpenSettings(this IServiceCollection services, IConfiguration configuration)

Parameters

services IServiceCollection

The IServiceCollection to which the OpenSettings services will be added.

configuration IConfiguration

The IConfiguration instance used to configure the settings.

Returns

IServiceCollection

The IServiceCollection with OpenSettings services configured.

Exceptions

ArgumentNullException

Thrown if services is null.