Kralizek.Extensions.Configuration.Objects
4.0.0-beta.1
See the version list below for details.
dotnet add package Kralizek.Extensions.Configuration.Objects --version 4.0.0-beta.1
NuGet\Install-Package Kralizek.Extensions.Configuration.Objects -Version 4.0.0-beta.1
<PackageReference Include="Kralizek.Extensions.Configuration.Objects" Version="4.0.0-beta.1" />
<PackageVersion Include="Kralizek.Extensions.Configuration.Objects" Version="4.0.0-beta.1" />
<PackageReference Include="Kralizek.Extensions.Configuration.Objects" />
paket add Kralizek.Extensions.Configuration.Objects --version 4.0.0-beta.1
#r "nuget: Kralizek.Extensions.Configuration.Objects, 4.0.0-beta.1"
#:package Kralizek.Extensions.Configuration.Objects@4.0.0-beta.1
#addin nuget:?package=Kralizek.Extensions.Configuration.Objects&version=4.0.0-beta.1&prerelease
#tool nuget:?package=Kralizek.Extensions.Configuration.Objects&version=4.0.0-beta.1&prerelease
Kralizek.Extensions.Configuration.Objects
Add strongly typed objects directly to a Microsoft.Extensions.Configuration pipeline.
Install
dotnet add package Kralizek.Extensions.Configuration.Objects
Add an object
builder.Configuration.AddObject(new
{
FeatureEnabled = true,
RetryCount = 3
});
You can place the object under a root section:
builder.Configuration.AddObject(settings, "MySettings");
AddObject appends the provider, so it has higher precedence than configuration providers already registered.
Add fallback defaults
Use AddObjectAsFallback when the object should provide defaults that other providers can override:
builder.Configuration
.AddObjectAsFallback(new
{
FeatureEnabled = false,
RetryCount = 3
})
.AddJsonFile("appsettings.json")
.AddEnvironmentVariables();
The object provider is inserted at the beginning of the provider chain, so later providers win.
Source-generated System.Text.Json
Both APIs have overloads accepting JsonTypeInfo<T>, which can be used with System.Text.Json source generation for trimming and Native AOT scenarios.
[JsonSerializable(typeof(MySettings))]
internal partial class AppJsonContext : JsonSerializerContext;
builder.Configuration.AddObject(
new MySettings { FeatureEnabled = true },
AppJsonContext.Default.MySettings);
The same overload is available for fallback configuration:
builder.Configuration.AddObjectAsFallback(
defaults,
AppJsonContext.Default.MySettings);
API
IConfigurationBuilder AddObject<T>(
T? value,
string? rootSectionName = "");
IConfigurationBuilder AddObject<T>(
T? value,
JsonTypeInfo<T> jsonTypeInfo,
string? rootSectionName = "");
IConfigurationBuilder AddObjectAsFallback<T>(
T? value,
string? rootSectionName = "");
IConfigurationBuilder AddObjectAsFallback<T>(
T? value,
JsonTypeInfo<T> jsonTypeInfo,
string? rootSectionName = "");
For source code, examples, and release notes, see the GitHub repository: https://github.com/Kralizek/ObjectConfigurationExtensions
| 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
- Microsoft.Extensions.Configuration (>= 10.0.11)
- System.Text.Json (>= 10.0.11)
-
net10.0
- Microsoft.Extensions.Configuration (>= 10.0.11)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Kralizek.Extensions.Configuration.Objects:
| Package | Downloads |
|---|---|
|
Kralizek.Extensions.Configuration.Objects.NewtonsoftJson
Extension of Kralizek.Extensions.Configuration using Newtonsoft.Json. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.0 | 100 | 8/27/2026 |
| 4.0.0-rc.1 | 65 | 8/24/2026 |
| 4.0.0-beta.2 | 55 | 8/24/2026 |
| 4.0.0-beta.1 | 57 | 8/22/2026 |
| 3.0.1 | 6,091 | 7/12/2024 |
| 3.0.0 | 2,295 | 1/30/2024 |
| 2.0.1 | 7,224 | 6/16/2021 |
| 2.0.0 | 1,924 | 6/10/2021 |
| 1.0.1 | 5,464 | 11/29/2019 |
| 1.0.0 | 893 | 11/3/2019 |