Lyo.Configuration
2.0.0
dotnet add package Lyo.Configuration --version 2.0.0
NuGet\Install-Package Lyo.Configuration -Version 2.0.0
<PackageReference Include="Lyo.Configuration" Version="2.0.0" />
<PackageVersion Include="Lyo.Configuration" Version="2.0.0" />
<PackageReference Include="Lyo.Configuration" />
paket add Lyo.Configuration --version 2.0.0
#r "nuget: Lyo.Configuration, 2.0.0"
#:package Lyo.Configuration@2.0.0
#addin nuget:?package=Lyo.Configuration&version=2.0.0
#tool nuget:?package=Lyo.Configuration&version=2.0.0
Lyo.Configuration
One helper, LyoOptions.Bind, used by every Add{Feature}FromConfiguration overload in the suite: start from the options type's declared defaults, overlay whatever the named section provides, then apply the caller's Action<TOptions> so values supplied in code win.
It is a package rather than a method on Lyo.Common.Core because it is the only thing in the suite that needs Microsoft.Extensions.Configuration.Binder. Keeping it separate leaves that dependency off the ~90 projects that reference Lyo.Common.Core for records, enums, and extensions and never touch configuration.
Features
- Uniform binding. Every package uses the same three-step path:
LyoOptions.Bind<TOptions>(configuration, sectionName, configure). - Missing sections are not errors. Defaults on the options type stay in place when the section is absent or empty.
- Code wins over configuration. Binding finishes first; then the optional
configuredelegate runs.
Examples
House FromConfiguration pattern
using Lyo.Configuration;
public IServiceCollection AddReportingDbContextFactoryFromConfiguration(
IConfiguration configuration,
string configSectionName = PostgresReportingOptions.SectionName)
{
var options = LyoOptions.Bind<PostgresReportingOptions>(configuration, configSectionName);
return services.AddReportingDbContextFactory(options);
}
Why check Exists() first
Binding a section that does not exist still succeeds silently, so section.Bind(options) alone would work. Checking Exists() first makes the intent explicit — a missing section means "defaults are fine", not "bind nothing and hope" — and it keeps the behaviour identical across every package rather than depending on each author's reading of the binder.
Dependencies
Generated from ProjectReference / PackageReference (same model as docs/Lyo.ProjectGraph.html).
Lyo.Exceptions(direct, lyo)Microsoft.Extensions.Configuration.Binder10.0.5(direct, microsoft)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Lyo.Exceptions (>= 2.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
-
net10.0
- Lyo.Exceptions (>= 2.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.5)
NuGet packages (71)
Showing the top 5 NuGet packages that depend on Lyo.Configuration:
| Package | Downloads |
|---|---|
|
Lyo.Api.Client
API client library for consuming Lyo APIs. |
|
|
Lyo.Cache
Cache service abstractions and local IMemoryCache implementation. |
|
|
Lyo.IO.Temp
Temp file and directory service with session tracking, logging, and metrics support. |
|
|
Lyo.Web.Components
Blazor components library for the Lyo web UI framework with MudBlazor integration. |
|
|
Lyo.FileMetadataStore
File store service interface and base implementation for metadata and file tracking. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.0.0 | 384 | 9/9/2026 |