SpaceWizards.ConfigProvider
1.0.2
dotnet add package SpaceWizards.ConfigProvider --version 1.0.2
NuGet\Install-Package SpaceWizards.ConfigProvider -Version 1.0.2
<PackageReference Include="SpaceWizards.ConfigProvider" Version="1.0.2" />
<PackageVersion Include="SpaceWizards.ConfigProvider" Version="1.0.2" />
<PackageReference Include="SpaceWizards.ConfigProvider" />
paket add SpaceWizards.ConfigProvider --version 1.0.2
#r "nuget: SpaceWizards.ConfigProvider, 1.0.2"
#addin nuget:?package=SpaceWizards.ConfigProvider&version=1.0.2
#tool nuget:?package=SpaceWizards.ConfigProvider&version=1.0.2
SS14.ConfigProvider
A configuration provider implementation for Microsoft.Extensions.Configuration providing configuration values from a configurable EfCore data source.
Usage
To use the configuration provider you need to use the AddConfigurationDb
.
It takes a DbContext
implementing IConfigurationDbContext
as a type parameter. You need to use the callback parameter to configure a DbContextOptionsBuilder
to use the correct database.
// Example using an in memory database
builder.Configuration.AddConfigurationDb<TestContext>(b => b.UseInMemoryDatabase("TestDb"));
Storing values
The configuration provider stores values in a table called ConfigurationStore
.
To store a value, you need to use the ConfigurationStore
entity. This package doesn't provide its own way of setting
values in the database. You need to use EfCore for that.
Working with dynamic configuration values
Using IConfiguration.Bind
works for when you call Bind
every time you want to get a configuration value.
A smarter approach is to use IOptionsSnapshot<T>
to get a snapshot of the configuration values in scoped services
IOptionsMonitor
for singleton services or when you need a delegate that gets called on configuration updates.
For more information see the Microsoft documentation about the options pattern.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. 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. |
-
net9.0
- JetBrains.Annotations (>= 2024.3.0)
- Microsoft.EntityFrameworkCore (>= 9.0.4)
- Microsoft.Extensions.Configuration (>= 9.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.0.2 | 47 | 5/3/2025 | |
1.0.1 | 115 | 5/1/2025 | |
1.0.0 | 106 | 5/1/2025 | |
0.0.0-alpha.0.12 | 187 | 5/1/2025 |