CodedThought.Core.Configuration 10.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package CodedThought.Core.Configuration --version 10.0.2
                    
NuGet\Install-Package CodedThought.Core.Configuration -Version 10.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="CodedThought.Core.Configuration" Version="10.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodedThought.Core.Configuration" Version="10.0.2" />
                    
Directory.Packages.props
<PackageReference Include="CodedThought.Core.Configuration" />
                    
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 CodedThought.Core.Configuration --version 10.0.2
                    
#r "nuget: CodedThought.Core.Configuration, 10.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.
#:package CodedThought.Core.Configuration@10.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CodedThought.Core.Configuration&version=10.0.2
                    
Install as a Cake Addin
#tool nuget:?package=CodedThought.Core.Configuration&version=10.0.2
                    
Install as a Cake Tool

CodedThought.Core.Configuration

A .NET Core Configuration manager to use with the CodedThought.Core framework or alone with any other .NET Core project

Usage of the CodedThought.Core.Configuration library is done with a few extension methods.

Installation and Usage

  1. Reference the package in Nuget.
  2. To add a reference to the standard .NET appSettings.json simply call the AddAppSettingsConfiguration extension method off of the builder class.
  3. To add an additional set of custom settings outside of the appSettings.json file.
    1. Create your own .json configuration file alongside the appsettings.json file. It should follow the appsettings.json JSON format.
    2. Add the AddCoreSettingsConfiguration extension method off of the app builder. You may choose to use the default ctSettings.json file name or provide your own.
  4. All methods support passing in the current environment to enable environment specific settings.
  5. Register the settings with AddCoreSettings so the section is bound once and validated when the host starts.
builder.Configuration.AddCoreSettingsConfiguration(env: builder.Environment, optional: false, reloadOnChange: true);
builder.Services.AddCoreSettings(builder.Configuration);

Configuration Sources

AddCoreSettingsConfiguration adds, in order, the settings file, the optional ctSettings.{Environment}.json overlay, and the environment variables. Pass includeEnvironmentVariables: false to omit the last source. The optional and reloadOnChange arguments are applied to the base settings file; the environment overlay is always optional.

Connection Accessors

Method Description & Remarks
GetCoreSettings() Binds the CoreSettings section into a new instance.
GetCorePrimaryConnection() Returns the connection marked Primary=true, or null when none is marked.
GetDatabaseConnection(name) Returns the connection matching the name, or null when absent. Matching ignores case.
GetRequiredCorePrimaryConnection() Returns the primary connection, throwing an InvalidOperationException that lists the configured connections when none is marked.
GetRequiredDatabaseConnection(name) Returns the named connection, throwing an InvalidOperationException that lists the configured connections when absent.
GetCoreDatabaseProviders() Returns the distinct ProviderType values across all configured connections.

Startup Validation

CoreSettingsValidator runs through ValidateOnStart() and reports every failure at once. It rejects a section with no connections, a connection count of Primary=true other than exactly one, duplicate connection names, a blank Name or ConnectionString, a negative Timeout, and any ProviderType outside SqlServer, Oracle, MongoDb, OleDb, MySql, ApiServer, and PostgreSQL.

Release Notes

Feature Description & Remarks
Options Pattern AddCoreSettings(IConfiguration) binds the CoreSettings section through IOptions<CoreSettings> and validates it with ValidateOnStart(). Inject IOptionsMonitor<CoreSettings> to observe settings-file changes, or IOptionsSnapshot<CoreSettings> for a value fixed for the lifetime of a request.
Required Connection Accessors Breaking. GetCorePrimaryConnection and GetDatabaseConnection now return a nullable ConnectionSetting, matching their actual behavior. Use the GetRequired* companions where a missing connection should throw.
Environment Variable Overlay The AddCoreSettingsConfiguration overloads now honor their optional and reloadOnChange arguments, always add the optional ctSettings.{Environment}.json overlay, and append the environment variable provider by default so secrets can be supplied from the environment.
Case-Insensitive Settings CoreSettings.Settings is matched without regard to case through the new TryGetSetting and GetSetting methods. ApplicationCookieName resolves regardless of its position in the file.
WINFORM Setting Removed Breaking. The WINFORM setting and the CoreSettings.IsWinForm property are removed.
Validation Messages Breaking. ValidationConfigurationProvider implements the new IValidationMessageProvider instead of IConfigurationProvider. Register it with AddCoreValidationMessages(IConfiguration). Absent or blank keys fall back to the built-in defaults.
CoreSettingsRoot Removed Breaking. The unused CoreSettingsRoot wrapper and the ValidationMessageElement type are removed.
Provider Validation Fixed ConnectionSetting.CheckProvider() no longer throws for valid providers. Supported types are exposed through ConnectionSetting.SupportedProviders.
Dependency Cleanup The Newtonsoft.Json reference is removed and Microsoft.Extensions.Hosting is narrowed to Hosting.Abstractions. Package versions are managed centrally from the root Directory.Packages.props.
Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on CodedThought.Core.Configuration:

Package Downloads
CodedThought.Core

The CodedThought.Core library is a custom entity framework used to primarily abstract the database away from consuming components or clients.

CodedThought.Core.Data.PostGreSQL

The CodedThought.Core.Data.PostGreSQL package is a custom database provider for use with PostgreSQL.

CodedThought.Core.Data.OleDb

The CodedThought.Core.Data.OleDb package is a custom database provider for use with OleDb Compatible Server.

CodedThought.Core.Data.Sybase

The CodedThought.Core.Data.Sybase package is a custom database provider for use with a Sybase Server.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.3 58 10/22/2026
10.0.2 43 10/22/2026
10.0.1 368 4/27/2026
10.0.0-alpha-1 530 11/18/2025
8.0.1.2 627 8/29/2025
8.0.1.1 529 3/21/2025
8.0.1 1,446 11/4/2024
8.0.0-rc.1 189 11/4/2024
8.0.0-beta-9 340 8/29/2024
8.0.0-beta-8 212 8/1/2024
8.0.0-beta-5 303 6/13/2024
6.0.0.7 588 10/26/2023

Upgraded to .NET 10