EasyAF_Configuration_IServiceCollectionExtensions

Provides extension methods for registering EasyAF configuration services in the dependency injection container.

Syntax

public static class EasyAF_Configuration_IServiceCollectionExtensions

Inheritance

Methods

AddConfigurationBase<TConfiguration>

public static TConfiguration AddConfigurationBase<TConfiguration>(this IServiceCollection services, IConfiguration configuration, string configSectionName) where TConfiguration : ConfigurationBase
Adds a configuration class that inherits from to the service collection. The configuration is bound from the specified configuration section and registered as both the specific type and the base type for dependency injection.

Parameters

  • services IServiceCollection: The service collection to add the configuration to.
  • configuration IConfiguration: The configuration instance to bind from.
  • configSectionName string: The name of the configuration section to bind from.

Returns

TConfiguration The bound configuration instance for immediate use or further configuration.