Bind complex value(such as JSON, XML) to options
How to use
Tuhu.Extensions.Configuration.ValueBinder.Json package.
Install theInstall-Package Tuhu.Extensions.Configuration.ValueBinder.Json
In your testing project, add the following framework
Bind IConfigurationSection json value
services.ConfigureJsonValue<TOptions>([string name, ]IConfigurationSection section, [NotNull] Func<FileConfigurationProvider> creator)
Bind json value
services.ConfigureJsonValue<TOptions>([string name, ]string value, [NotNull] Func<FileConfigurationProvider> creator)
Bind IConfiguration json values
Map child section Key
to options name, map empty section key
or Value
(if is IConfigurationSection) to default options
services.ConfigureJsonValues<TOptions>(IConfiguration configuration, [NotNull] Func<FileConfigurationProvider> creator)
Tuhu.Extensions.Configuration.ValueBinder package.
Install theInstall-Package Tuhu.Extensions.Configuration.ValueBinder
In your testing project, add the following framework
Bind IConfigurationSection value
services.ConfigureValue<TOptions>([string name, ]IConfigurationSection section, [NotNull] Func<FileConfigurationProvider> creator)
Bind string value
services.ConfigureValue<TOptions>([string name, ]string value, [NotNull] Func<FileConfigurationProvider> creator)
Bind IConfiguration values
Map child section Key
to options name, map empty section key
or Value
(if is IConfigurationSection) to default options
services.ConfigureValues<TOptions>(IConfiguration configuration, [NotNull] Func<FileConfigurationProvider> creator)