Class HostBuilderExtensions
- Namespace
- OpenSettings.Extensions
- Assembly
- OpenSettings.dll
Provides extension methods for configuring an IHostBuilder.
public static class HostBuilderExtensions
- Inheritance
-
HostBuilderExtensions
- Inherited Members
Methods
UseOpenSettingsAsync(IHostBuilder, OpenSettingsConfiguration, Func<IConfiguration, Task>, params Type[])
Configures the host builder to use OpenSettings with the specified configuration, an additional configuration function,
and application settings types.
If settingsTypes
are provided, only these types (which must implement ISettings) will be used.
Otherwise, available types implementing ISettings will be automatically discovered via reflection.
public static Task<IHostBuilder> UseOpenSettingsAsync(this IHostBuilder hostBuilder, OpenSettingsConfiguration openSettingsConfiguration, Func<IConfiguration, Task> configureFunc, params Type[] settingsTypes)
Parameters
hostBuilder
IHostBuilderThe host builder instance to configure.
openSettingsConfiguration
OpenSettingsConfigurationThe OpenSettings configuration to be applied.
configureFunc
Func<IConfiguration, Task>An optional asynchronous function to apply additional configuration using IConfiguration.
settingsTypes
Type[]An array of types representing the settings. Each type must implement ISettings. If not provided, types will be discovered automatically.
Returns
- Task<IHostBuilder>
A task that resolves to the configured IHostBuilder.
UseOpenSettingsAsync(IHostBuilder, OpenSettingsConfiguration, params Type[])
Configures the host builder to use OpenSettings with the specified configuration and application settings types.
If settingsTypes
are provided, only these types (which must implement ISettings) will be used.
Otherwise, available types implementing ISettings will be automatically discovered via reflection.
public static Task<IHostBuilder> UseOpenSettingsAsync(this IHostBuilder hostBuilder, OpenSettingsConfiguration openSettingsConfiguration, params Type[] settingsTypes)
Parameters
hostBuilder
IHostBuilderThe host builder instance to configure.
openSettingsConfiguration
OpenSettingsConfigurationThe OpenSettings configuration to be applied.
settingsTypes
Type[]An array of types representing the settings. Each type must implement ISettings. If not provided, types will be discovered automatically.
Returns
- Task<IHostBuilder>
A task that resolves to the configured IHostBuilder.