KeysetEngine.Core 1.0.0

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

KeysetEngine

CI License: MIT NuGet

High-performance, database-agnostic keyset pagination and universal search library for .NET 8, .NET 9, and .NET 10 with Entity Framework Core.

Keyset pagination avoids the $O(N)$ execution degradation inherent to SQL OFFSET on deep datasets by establishing stable, indexed boundaries using composite keys and opaque cursors.


Packages

Package NuGet Description
KeysetEngine.Core NuGet Core contracts, expression builders, $N+1$ slicing, universal search, and IQueryable<T> extensions.
KeysetEngine.DataProtection NuGet Cryptographic ASP.NET Core Data Protection cursor tokens with purpose isolation.
KeysetEngine.PostgreSql NuGet PostgreSQL search adapter with EF.Functions.ILike and tsvector full-text search.
KeysetEngine.SqlServer NuGet SQL Server search adapter with EF.Functions.FreeText / CONTAINS and collation strategies.

Features

  • True $O(1)$ Keyset Pagination: No slow OFFSET scans; uses nested boolean comparison trees compatible with SQL Server, PostgreSQL, and SQLite.
  • Bidirectional Traversal: Seamless forward and backward page navigation with automated in-memory ordering reversal.
  • Tamper-Proof Opaque Cursors: Cryptographic protection via ASP.NET Core Data Protection with purpose and entity isolation.
  • Dynamic Multi-Column Search: Search across multiple properties without breaking keyset boundaries or client-side evaluation.
  • Multi-Targeting Support: Native support for modern LTS and Current .NET runtimes (net8.0, net9.0, net10.0).

Quickstart

1. Register Services

// In Program.cs / Startup.cs
builder.Services.AddKeysetPagination();

// Optional: Register database-specific search strategy
builder.Services.AddKeysetPostgreSqlSearch(); // or AddKeysetSqlServerSearch()

2. Configure Entity Keyset

var config = new KeysetConfigBuilder<Order>()
    .SortBy(x => x.CreatedAt, ascending: false)
    .TieBreakBy(x => x.Id)
    .SearchIn(x => x.CustomerName, x => x.OrderNumber)
    .Build();

3. Query Paginated Data

app.MapGet("/orders", async (
    [AsParameters] KeysetRequest request,
    AppDbContext db,
    ICursorProtector protector,
    CancellationToken ct) =>
{
    var page = await db.Orders
        .AsNoTracking()
        .ToKeysetPageAsync(request, config, protector, ct);

    return Results.Ok(page);
});

Semantic Versioning & Releases

KeysetEngine adheres strictly to Semantic Versioning 2.0.0. Releases and packages are tagged and published automatically using MinVer and NuGet Trusted Publishing (OIDC).


License

This project is licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  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 (3)

Showing the top 3 NuGet packages that depend on KeysetEngine.Core:

Package Downloads
KeysetEngine.DataProtection

Cryptographic ASP.NET Core Data Protection cursor tokens with purpose and entity isolation for KeysetEngine.

KeysetEngine.SqlServer

Microsoft SQL Server dialect search adapters for KeysetEngine using EF.Functions.FreeText, CONTAINS, and collation strategies.

KeysetEngine.PostgreSql

PostgreSQL dialect search adapters for KeysetEngine using EF.Functions.ILike and tsvector full-text search.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 0 10/17/2026