Soenneker.Redis.Util.Server 11.0.3223

Prefix Reserved
dotnet add package Soenneker.Redis.Util.Server --version 11.0.3223
                    
NuGet\Install-Package Soenneker.Redis.Util.Server -Version 11.0.3223
                    
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="Soenneker.Redis.Util.Server" Version="11.0.3223" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Redis.Util.Server" Version="11.0.3223" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Redis.Util.Server" />
                    
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 Soenneker.Redis.Util.Server --version 11.0.3223
                    
#r "nuget: Soenneker.Redis.Util.Server, 11.0.3223"
                    
#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 Soenneker.Redis.Util.Server@11.0.3223
                    
#: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=Soenneker.Redis.Util.Server&version=11.0.3223
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Redis.Util.Server&version=11.0.3223
                    
Install as a Cake Tool

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
11.0.3223 0 11/15/2026
11.0.3222 83 11/13/2026
11.0.3221 48 11/12/2026
11.0.3220 105 11/11/2026
11.0.3219 66 11/11/2026
11.0.3218 59 11/11/2026
11.0.3217 68 11/11/2026
11.0.3216 78 11/11/2026
11.0.3214 70 11/11/2026
11.0.3213 46 11/11/2026
11.0.3212 46 11/11/2026
11.0.3211 106 11/11/2026
11.0.3210 277 11/3/2026
11.0.3209 107 11/3/2026
11.0.3208 120 11/3/2026
11.0.3207 115 11/3/2026
11.0.3206 114 11/3/2026
11.0.3205 106 11/3/2026
11.0.3204 116 11/3/2026
11.0.3203 123 11/3/2026
Loading failed

Update dependency Soenneker.Redis.Util to 11.0.5558 (#3931)