Tuhu.Extensions.Configuration.ValueBinder.Json

Bind complex value(such as JSON, XML) to options


Keywords
Microsoft.Extensions.Configuration.Xml, JsonBind, Microsoft.Extensions.Configuration.Json, XmlBind, ValueBind
Install
Install-Package Tuhu.Extensions.Configuration.ValueBinder.Json -Version 1.0.0

Documentation

Bind complex value(such as JSON, XML) to options

How to use

Install the Tuhu.Extensions.Configuration.ValueBinder.Json package.

Install-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)

Install the Tuhu.Extensions.Configuration.ValueBinder package.

Install-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)