https://github.com/soenneker/soenneker.config.realtime
A configuration provider allowing for realtime modification
https://github.com/soenneker/soenneker.config.realtime
config configuration csharp dotnet provider realtime realtimeconfigurationprovider service source util
Last synced: 3 months ago
JSON representation
A configuration provider allowing for realtime modification
- Host: GitHub
- URL: https://github.com/soenneker/soenneker.config.realtime
- Owner: soenneker
- License: mit
- Created: 2024-12-28T21:15:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-03-31T12:46:55.000Z (3 months ago)
- Last Synced: 2026-03-31T14:42:06.856Z (3 months ago)
- Topics: config, configuration, csharp, dotnet, provider, realtime, realtimeconfigurationprovider, service, source, util
- Language: C#
- Homepage: https://soenneker.com
- Size: 859 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
[](https://www.nuget.org/packages/soenneker.config.realtime/)
[](https://github.com/soenneker/soenneker.config.realtime/actions/workflows/publish-package.yml)
[](https://www.nuget.org/packages/soenneker.config.realtime/)
[](https://github.com/soenneker/soenneker.config.realtime/actions/workflows/codeql.yml)
#  Soenneker.Config.Realtime
### Real-time, thread-safe configuration updates for .NET applications.
## Features
- **Real-Time Updates**: Dynamically add, update, or remove configuration values at runtime.
- **Thread-Safe**: Safe updates in multi-threaded environments.
- **Hierarchical Keys**: Supports nested keys using `:` as a separator (e.g., `AppSettings:FeatureFlag`).
- **Automatic Propagation**: Updates are reflected in `IConfiguration` consumers.
---
## Installation
```bash
dotnet add package Soenneker.Config.Realtime
```
You just need access to `IServiceCollection` and `IBuilderConfiguration`:
```csharp
serviceCollection.AddRealtimeConfiguration(builderConfiguration);
```
This is just one example:
```csharp
var builder = WebApplication.CreateBuilder(args);
// Add and register the RealtimeConfigurationProvider in one step
builder.Services.AddRealtimeConfiguration(builder.Configuration);
var app = builder.Build();
```
## Usage
```csharp
public class MyService
{
private readonly IRealtimeConfigurationProvider _configProvider;
private readonly IConfiguration _config;
// Simply inject IRealtimeConfigurationProvider:
public MyService(IRealtimeConfigurationProvider configProvider, IConfiguration config)
{
_configProvider = configProvider;
_config = config;
}
public void SetKeyDynamically()
{
// Make your updates
_configProvider.Set("SomeKey", "SomeValue");
}
public void ReadUpdatedValue()
{
// IConfiguration is now updated
string newValue = _config["SomeKey"]; // Outputs: "SomeValue"
}
}
```