Soenneker.Redis.Util.Server
4.0.3063
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Redis.Util.Server --version 4.0.3063
NuGet\Install-Package Soenneker.Redis.Util.Server -Version 4.0.3063
<PackageReference Include="Soenneker.Redis.Util.Server" Version="4.0.3063" />
<PackageVersion Include="Soenneker.Redis.Util.Server" Version="4.0.3063" />
<PackageReference Include="Soenneker.Redis.Util.Server" />
paket add Soenneker.Redis.Util.Server --version 4.0.3063
#r "nuget: Soenneker.Redis.Util.Server, 4.0.3063"
#:package Soenneker.Redis.Util.Server@4.0.3063
#addin nuget:?package=Soenneker.Redis.Util.Server&version=4.0.3063
#tool nuget:?package=Soenneker.Redis.Util.Server&version=4.0.3063
Soenneker.Redis.Util.Server
Server-level Redis scanning, bulk lookup, bulk deletion, and database-flush operations.
These operations can scan or delete large portions of Redis. Keep them out of request hot paths and restrict access to trusted administrative workflows.
Installation and registration
dotnet add package Soenneker.Redis.Util.Server
using Soenneker.Redis.Util.Server.Registrars;
services.AddRedisServerUtilAsScoped();
The scoped registrar keeps the Redis client and server client singleton while scoping the utility wrappers. Disposing a scope therefore does not close the shared connection.
Configuration uses Azure:Redis:ConnectionString, as described by Soenneker.Redis.Client. The client enables administrative commands; the Redis credentials still need server permission for operations such as FLUSHALL.
Read keys by prefix
IReadOnlyDictionary<string, Order>? orders =
await redisServer.GetKeyValuesByPrefix<Order>("orders", cancellationToken);
List<RedisKey>? keys =
await redisServer.GetKeysByPrefixList("orders:pending", cancellationToken);
The utility appends a trailing * when one is absent. Prefix strings are Redis glob patterns, so characters such as ?, [, and ] retain their Redis pattern meaning. The prefix lookup methods use the server endpoint selected by IRedisServerClient; they are not a cluster-wide aggregation.
Remove keys across writable endpoints
For cluster-aware cleanup, prefer RemoveByScan. It scans every connected non-replica endpoint and pipelines matching deletes:
long removed = await redisServer.RemoveByScan(
"sessions:",
key => key.ToString().EndsWith(":expired", StringComparison.Ordinal),
batchSize: 500,
cancellationToken);
A null or empty prefix scans all keys, leaving shouldRemove as the only filter. Keep the predicate narrow and test it before using this against production data.
RemoveByPrefix is the older single-endpoint path. Its fireAndForget parameter queues individual removals through IRedisUtil; use false when completion matters.
Flush
await redisServer.Flush(cancellationToken);
Flush issues FLUSHALL to the selected server endpoint and destroys all databases on that server. The method logs server failures rather than returning a success result or rethrowing them, so verify the resulting state when an administrative workflow requires confirmation.
| 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. |
-
net10.0
- Soenneker.Redis.Client.Server (>= 4.0.2223)
- Soenneker.Redis.Util (>= 4.0.5379)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Soenneker.Redis.Util.Server:
| Package | Downloads |
|---|---|
|
Soenneker.Redis.Suite
A concoction of Redis utilities and libraries |
|
|
Soenneker.Hangfire.Redis.Util
Removes Hangfire job data directly from Redis while preserving selected jobs and infrastructure metadata |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.3064 | 0 | 8/31/2026 |
| 4.0.3063 | 0 | 8/30/2026 |
| 4.0.3062 | 0 | 8/30/2026 |
| 4.0.3061 | 0 | 8/30/2026 |
| 4.0.3060 | 0 | 8/30/2026 |
| 4.0.3059 | 16 | 8/30/2026 |
| 4.0.3058 | 27 | 8/30/2026 |
| 4.0.3057 | 67 | 8/29/2026 |
| 4.0.3056 | 43 | 8/29/2026 |
| 4.0.3054 | 101 | 8/27/2026 |
| 4.0.3053 | 88 | 8/26/2026 |
| 4.0.3052 | 64 | 8/26/2026 |
| 4.0.3051 | 53 | 8/26/2026 |
| 4.0.3050 | 69 | 8/26/2026 |
| 4.0.3049 | 42 | 8/26/2026 |
| 4.0.3048 | 138 | 8/22/2026 |
| 4.0.3047 | 107 | 8/22/2026 |
| 4.0.3046 | 116 | 8/21/2026 |
| 4.0.3045 | 238 | 8/21/2026 |
| 4.0.3044 | 93 | 8/21/2026 |
Update dependency Soenneker.Redis.Util to 4.0.5374 (#3750)