Summary
The refactoring plan specifies a LoadFromConfiguration(IConfiguration config) method on GeneralUpdateBootstrap for loading settings from appsettings.json, environment variables, and command-line args. This is not yet implemented.
Expected API
// Load from IConfiguration (Microsoft.Extensions.Configuration)
new GeneralUpdateBootstrap()
.LoadFromConfiguration(builder.Configuration)
.LaunchAsync();
// Load from appsettings.json section
new GeneralUpdateBootstrap()
.LoadFromConfiguration(config.GetSection("GeneralUpdate"))
.LaunchAsync();
Expected Behavior
- Map
IConfiguration keys to UpdateOptions and Configinfo fields
- Priority: code
.Option() calls override configuration values
- Support standard
appsettings.json bindings:
GeneralUpdate:AppType
GeneralUpdate:UpdateUrl
GeneralUpdate:AppSecretKey
GeneralUpdate:DiffMode
GeneralUpdate:Silent, etc.
- Chainable:
.LoadFromConfiguration(config).Option(UpdateOptions.Silent, true) — code overrides config
Benefits
- Zero-code configuration for common scenarios
- Standard .NET configuration pattern
- Enables environment-specific configs (appsettings.Development.json, appsettings.Production.json)
Ref
Refactoring plan v2: Section 2.3, "LoadFromConfiguration"
Summary
The refactoring plan specifies a
LoadFromConfiguration(IConfiguration config)method onGeneralUpdateBootstrapfor loading settings fromappsettings.json, environment variables, and command-line args. This is not yet implemented.Expected API
Expected Behavior
IConfigurationkeys toUpdateOptionsandConfiginfofields.Option()calls override configuration valuesappsettings.jsonbindings:GeneralUpdate:AppTypeGeneralUpdate:UpdateUrlGeneralUpdate:AppSecretKeyGeneralUpdate:DiffModeGeneralUpdate:Silent, etc..LoadFromConfiguration(config).Option(UpdateOptions.Silent, true)— code overrides configBenefits
Ref
Refactoring plan v2: Section 2.3, "LoadFromConfiguration"