EPS.Extensions.RedisConfig
10.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package EPS.Extensions.RedisConfig --version 10.0.0
NuGet\Install-Package EPS.Extensions.RedisConfig -Version 10.0.0
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="EPS.Extensions.RedisConfig" Version="10.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EPS.Extensions.RedisConfig" Version="10.0.0" />
<PackageReference Include="EPS.Extensions.RedisConfig" />
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 EPS.Extensions.RedisConfig --version 10.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EPS.Extensions.RedisConfig, 10.0.0"
#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 EPS.Extensions.RedisConfig@10.0.0
#: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=EPS.Extensions.RedisConfig&version=10.0.0
#tool nuget:?package=EPS.Extensions.RedisConfig&version=10.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EPS.Extensions.RedisConfig
A .NET 10 library that extends Microsoft.Extensions.Configuration to read configuration from Redis cache using Redis.OM.
Features
- JSON Document Storage: Store your entire configuration as a JSON document in Redis
- Multiple Reload Modes:
- None: Configuration loaded once at startup
- Polling: Periodically poll Redis for changes
- Pub/Sub: Real-time configuration updates via Redis Pub/Sub
- Optional Provider: Gracefully handle Redis unavailability
- Full Configuration Binding: Works with all standard .NET configuration patterns
Installation
dotnet add package EPS.Extensions.RedisConfig
Usage
Basic Usage
var builder = new ConfigurationBuilder();
builder.AddRedisConfiguration("localhost:6379", "myapp:config");
var configuration = builder.Build();
var value = configuration["MySetting"];
With Polling Reload
builder.AddRedisConfigurationWithPolling(
connectionString: "localhost:6379",
configurationKey: "myapp:config",
pollingInterval: TimeSpan.FromSeconds(30));
With Pub/Sub Reload
builder.AddRedisConfigurationWithPubSub(
connectionString: "localhost:6379",
configurationKey: "myapp:config",
pubSubChannel: "myapp:config:changed");
Full Options Configuration
builder.AddRedisConfiguration(options =>
{
options.ConnectionString = "localhost:6379";
options.ConfigurationKey = "myapp:config";
options.ReloadMode = ReloadMode.Polling;
options.PollingInterval = TimeSpan.FromSeconds(15);
options.Optional = true;
options.CommandTimeout = TimeSpan.FromSeconds(5);
});
Optional Provider
builder.AddRedisConfiguration(
connectionString: "localhost:6379",
configurationKey: "myapp:config",
optional: true);
Redis Data Format
Store your configuration in Redis as a JSON document:
redis-cli SET myapp:config '{"Logging":{"LogLevel":{"Default":"Information"}},"ConnectionStrings":{"Database":"Server=..."}}'
The JSON is automatically flattened to configuration keys:
Logging:LogLevel:Default="Information"ConnectionStrings:Database="Server=..."
Pub/Sub Notifications
When using ReloadMode.PubSub, publish a message to the configured channel to trigger a reload:
redis-cli PUBLISH myapp:config:changed "reload"
License
MIT License - see LICENSE file for details.
| Product | Versions 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.
-
net10.0
- Microsoft.Extensions.Configuration (>= 10.0.0-preview.1.25080.5)
- Redis.OM (>= 0.7.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release of Redis configuration provider.