SpaceWizards.ConfigProvider 1.0.2

dotnet add package SpaceWizards.ConfigProvider --version 1.0.2
                    
NuGet\Install-Package SpaceWizards.ConfigProvider -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SpaceWizards.ConfigProvider" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SpaceWizards.ConfigProvider" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="SpaceWizards.ConfigProvider" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SpaceWizards.ConfigProvider --version 1.0.2
                    
#r "nuget: SpaceWizards.ConfigProvider, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=SpaceWizards.ConfigProvider&version=1.0.2
                    
Install SpaceWizards.ConfigProvider as a Cake Addin
#tool nuget:?package=SpaceWizards.ConfigProvider&version=1.0.2
                    
Install SpaceWizards.ConfigProvider as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 0.0.0-alpha.0.12 is deprecated because it is no longer maintained.