EricksonLopez.Pagination
dotnet-pagination · Querying & Data
On this page (20 sections)
1. Identity, Tier & Maturity Profile#
2. Value Proposition & Problem Solved#
A flexible and easy-to-use pagination library for .NET applications, providing reusable components and seamless integration with modern web APIs.
OFFSET/LIMIT pagination degrades linearly at deep page offsets, scanning and discarding millions of rows and thrashing database buffer pools.
3. Quick Install#
Primary package: EricksonLopez.Pagination
dotnet add package EricksonLopez.Pagination --version 2.0.0<PackageReference Include="EricksonLopez.Pagination" Version="2.0.0" /><PackageVersion Include="EricksonLopez.Pagination" Version="2.0.0" />4. Verified Ecosystem Metrics#
Snapshot retrieved UTC: 2026-12-01
5. When to Use & When Not to Use#
When to use
- You need O(log N) keyset cursor pagination with HMAC-SHA256 signed cursors, count-less offset optimization, or IAsyncEnumerable streaming.
When NOT to use
- You only return small bounded lookup tables (<100 rows) that fit in a single query without paging.
6. Core Capabilities & Design Invariants#
HMAC-SHA256 Tamper-Proof Cursors
HmacCursorEncoder provides constant-time verification, TTL expiration, clock-skew tolerance, and Redis replay defense.
Multi-Store & UI Adapters
Adapters for Dapper, EF Core, Cosmos DB, Elasticsearch, MongoDB, ASP.NET Core OpenAPI, and Blazor.
7. Included NuGet Packages & Adapters#
| Package ID | Status | NuGet / Local | TFMs | AOT Status | Downloads | Description |
|---|---|---|---|---|---|---|
| EricksonLopez.PaginationPrimary | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 1,712 | Zero-allocation pagination lists and core implementations. |
| EricksonLopez.Pagination.Abstractions | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 1,978 | Standard pagination primitives and parameters interfaces. |
| EricksonLopez.Pagination.Relay | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 379 | GraphQL Relay Cursor Connections specification adapter for the EricksonLopez.Pagination ecosystem. |
| EricksonLopez.Pagination.OpenApi | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 259 | Swagger and OpenAPI pagination documentation extensions for the EricksonLopez.Pagination ecosystem. |
| EricksonLopez.Pagination.Cosmos | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Incompatible | 257 | Azure Cosmos DB pagination extensions for the EricksonLopez.Pagination ecosystem. |
| EricksonLopez.Pagination.EntityFrameworkCore | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 256 | Entity Framework Core async offset and keyset cursor pagination extensions for EricksonLopez.Pagination. |
| EricksonLopez.Pagination.Result | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 254 | Result pattern integration extensions for EricksonLopez.Pagination. |
| EricksonLopez.Pagination.MongoDB | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Incompatible | 251 | MongoDB Driver offset and cursor pagination extensions for the EricksonLopez.Pagination ecosystem. |
| EricksonLopez.Pagination.Elasticsearch | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Incompatible | 250 | Elasticsearch 8.x search_after cursor pagination extensions for the EricksonLopez.Pagination ecosystem. |
| EricksonLopez.Pagination.LinqToDB | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 246 | LinqToDB async offset and keyset cursor pagination extensions for EricksonLopez.Pagination. |
| EricksonLopez.Pagination.Grpc | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 239 | gRPC protobuf message mappings and utilities for the EricksonLopez.Pagination ecosystem. |
| EricksonLopez.Pagination.Dapper | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 238 | Dapper integration for EricksonLopez.Pagination. Provides offset and keyset pagination extension methods for IDbConnection. |
| EricksonLopez.Pagination.AspNetCore | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 236 | ASP.NET Core Minimal APIs and MVC integration for EricksonLopez.Pagination. |
| EricksonLopez.Pagination.Blazor | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 226 | Headless Blazor pagination components for the EricksonLopez.Pagination ecosystem. |
| EricksonLopez.Pagination.Redis | Published | v2.0.0 / v3.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 223 | Distributed Redis replay protection store for the EricksonLopez.Pagination ecosystem. |
| EricksonLopez.Pagination.SourceGeneratorsAnalyzer / Generator | Published | v2.0.0 / v3.0.0 | netstandard2.0 | AOT: N/A (Analyzer/Legacy) | 245 | Roslyn source generator for Native AOT cursor decoders in EricksonLopez.Pagination. |
| EricksonLopez.Pagination.AnalyzersAnalyzer / Generator | Published | v2.0.0 / v3.0.0 | netstandard2.0 | AOT: N/A (Analyzer/Legacy) | 219 | Roslyn analyzers for catching pagination bugs at compile time in EricksonLopez.Pagination. |
8. Quick Start Code Example#
Grounded in verified public APIs from EricksonLopez.Pagination. Compile with `<ImplicitUsings>disable</ImplicitUsings>` and explicit imports.
using System;
using EricksonLopez.Pagination;
using EricksonLopez.Pagination.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddPagination(options =>
{
options.Cursor.Encoder = new HmacCursorEncoder(
secretKey: builder.Configuration["Pagination:SecretKey"]!,
timeToLive: TimeSpan.FromMinutes(30),
clockSkewTolerance: TimeSpan.FromSeconds(30));
options.MaxPageSize = 100;
options.DefaultPageSize = 20;
});9. Architecture & Dependency Flow#
Rendering diagram…
flowchart LR lib_pagination["EricksonLopez.Pagination (L2)"] lib_result["EricksonLopez.Result (L0)"] lib_pagination -.-> lib_result lib_dapper_extensions["EricksonLopez.DapperExtensions (L3)"] lib_dapper_extensions --> lib_pagination lib_sql_builder["EricksonLopez.SqlBuilder (L3)"] lib_sql_builder -.-> lib_pagination
View accessible text summary and structure
1 upstream library dependencies and 2 downstream dependent libraries verified in dependencies.json.
| Direction | Library | Tier | Relationship Kinds |
|---|---|---|---|
| Upstream | EricksonLopez.Result | L0 | Adapter, NuGet Package |
| Downstream | EricksonLopez.DapperExtensions | L3 | Adapter, Compile-Time, NuGet Package |
| Downstream | EricksonLopez.SqlBuilder | L3 | Adapter, NuGet Package |
flowchart LR
lib_pagination["EricksonLopez.Pagination (L2)"]
lib_result["EricksonLopez.Result (L0)"]
lib_pagination -.-> lib_result
lib_dapper_extensions["EricksonLopez.DapperExtensions (L3)"]
lib_dapper_extensions --> lib_pagination
lib_sql_builder["EricksonLopez.SqlBuilder (L3)"]
lib_sql_builder -.-> lib_pagination10. Target Frameworks & Native AOT / Trimming Matrix#
MSBuild `.csproj` inspection across 17 packages: 12 Full, 0 Partial, 3 Incompatible, 2 NotApplicable (analyzers/generators).
| Package ID | IsAotCompatible | EnableTrimAnalyzer | Verified AOT Status | Target Frameworks |
|---|---|---|---|---|
| EricksonLopez.Pagination | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.Abstractions | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.Relay | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.OpenApi | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.Cosmos | false | true | Incompatible | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.EntityFrameworkCore | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.Result | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.MongoDB | false | true | Incompatible | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.Elasticsearch | false | true | Incompatible | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.LinqToDB | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.Grpc | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.Dapper | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.AspNetCore | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.Blazor | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.Redis | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Pagination.SourceGenerators | false | null | NotApplicable | netstandard2.0 |
| EricksonLopez.Pagination.Analyzers | false | null | NotApplicable | netstandard2.0 |
11. Upstream Dependencies & Downstream Dependents#
Upstream Dependencies (1)
Downstream Dependents (2)
12. Optional Adapters & Third-Party Integrations#
Internal Adapter Edges & Integration Packages
- EricksonLopez.DapperExtensions→ EricksonLopez.Pagination.Abstractions
- EricksonLopez.Pagination.Result→ EricksonLopez.Result (EricksonLopez.Result)
- EricksonLopez.SqlBuilder.Dapper (EricksonLopez.SqlBuilder)→ EricksonLopez.Pagination
- EricksonLopez.SqlBuilder.Dapper (EricksonLopez.SqlBuilder)→ EricksonLopez.Pagination.Abstractions
- EricksonLopez.SqlBuilder.Pagination (EricksonLopez.SqlBuilder)→ EricksonLopez.Pagination
- EricksonLopez.SqlBuilder.Pagination (EricksonLopez.SqlBuilder)→ EricksonLopez.Pagination.Abstractions
Verified External NuGet Dependencies (18)
13. Configuration & DI Registration Summary#
Verified DI & Configuration Entry Points
PaginationEndpointExtensions.AddPaginationValidationAdds pagination validation endpoint filters to the route group builder.
PaginationServiceCollectionExtensions.AddPaginationRegisters pagination services, options validation, and MVC model binder providers in the service collection.
PaginationServiceCollectionExtensions.AddPaginationCursorEncoderRegisters the default `ICursorEncoder` into the service collection.
PaginationBlazorServiceCollectionExtensions.AddPaginationBlazorRegisters Blazor pagination UI options in the service collection.
CursorSqlBuilder.UseDialectSpecifies the target SQL database dialect for query generation.
DapperKeysetBuilder<T>.UseDialectInherits documentation from `CursorSqlBuilder.UseDialect`.
PaginationOpenApiOptionsExtensions.AddPaginationSupportConfigures OpenAPI options to include pagination, filtering, and sorting parameter descriptions.
PaginationSwaggerGenOptionsExtensions.AddPaginationSupportConfigures Swashbuckle options to include pagination, filtering, and sorting parameter descriptions.
RedisPaginationServiceCollectionExtensions.AddPaginationRedisReplayStoreRegisters `RedisCursorReplayStore` as the `ICursorReplayStore` implementation resolving `IConnectionMultiplexer` from DI.
Key Public Types & Contracts
EricksonLopez.Pagination.Base64CursorEncoder (class)Encapsulates a Base64-based cursor encoder that transforms cursor strings into URL-safe Base64 representations.
EricksonLopez.Pagination.CountedCursorPagedList`1 (class)Represents an immutable paginated list with cursor-based metadata and an exact total count.
EricksonLopez.Pagination.CountedPagedList`1 (class)Represents an immutable paginated list with a known total count.
EricksonLopez.Pagination.CursorPagedList`1 (class)Represents an immutable paginated list with cursor-based metadata.
EricksonLopez.Pagination.CursorPaginationParametersExtensions (class)Provides extension methods for decoding cursors from `CursorPaginationParameters`.
EricksonLopez.Pagination.DefaultPagedListFactory (class)Provides the default implementation of `IPagedListFactory` and `ICursorPagedListFactory`.
EricksonLopez.Pagination.FilterUnknownFieldBehavior (enum)Specifies the behavior when a filter parameter references a field that does not exist on the target entity.
EricksonLopez.Pagination.HmacCursorEncoder (class)Provides HMAC-SHA256 signing and verification of cursor values to prevent tampering.
EricksonLopez.Pagination.ICursorEncoder (interface)Defines a contract for encoding and decoding opaque pagination cursors.
EricksonLopez.Pagination.ICursorPagedListExtensions (class)Provides extension methods for `ICursorPagedList<T>` instances.
EricksonLopez.Pagination.InMemoryCursorDecoderRegistry (class)Provides an in-memory, thread-safe implementation of `ICursorDecoderRegistry`.
EricksonLopez.Pagination.InMemoryCursorReplayStore (class)Provides an in-memory, thread-safe implementation of `ICursorReplayStore`.
14. Verified Performance Benchmarks#
All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).
| Suite | Method | Runtime | Mean (ns) | Allocated (B) | Status |
|---|---|---|---|---|---|
| CursorEncoderBenchmarks | EncodeBase64 | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 20.93 | 128 | measured |
| CursorEncoderBenchmarks | DecodeBase64 | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 25.37 | 96 | measured |
| FilterExpressionBenchmarks | BuildExpression_Warm | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 29.05 | 176 | measured |
| CursorEncoderBenchmarks | EncodeHmac | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 283.31 | 768 | measured |
| CursorEncoderBenchmarks | DecodeHmac | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 416.24 | 616 | measured |
| FilterExpressionBenchmarks | BuildExpression_Cold | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 851.56 | 1,968 | measured |
| OffsetPaginationBenchmark | EricksonLopez | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 218,500 | 28,600 | measured |
| OffsetPaginationBenchmark | RawSqlOffset | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 228,500 | 27,044 | measured |
| OffsetPaginationBenchmark | Ardalis | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 229,400 | 25,354 | measured |
| OffsetPaginationBenchmark | RawSqlOffset | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 231,600 | 26,644 | measured |
| OffsetPaginationBenchmark | Ardalis | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 232,500 | 26,900 | measured |
| OffsetPaginationBenchmark | EricksonLopez | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 243,800 | 28,252 | measured |
| OffsetPaginationBenchmark | Sieve | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 283,400 | 34,560 | measured |
| OffsetPaginationBenchmark | Sieve | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 303,600 | 34,171 | measured |
| FilterPaginationBenchmark | EricksonLopez | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 307,800 | 38,554 | measured |
| FilterPaginationBenchmark | RawSqlOffset | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 315,700 | 39,885 | measured |
| FilterPaginationBenchmark | Ardalis | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 318,500 | 37,325 | measured |
| OffsetPaginationBenchmark | RawSqlOffset | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 485,400 | 125,829 | measured |
| OffsetPaginationBenchmark | Ardalis | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 526,700 | 124,037 | measured |
| OffsetPaginationBenchmark | EricksonLopez | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 556,400 | 129,198 | measured |
| OffsetPaginationBenchmark | Sieve | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 566,500 | 133,243 | measured |
| FilterPaginationBenchmark | Ardalis | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 677,000 | 175,196 | measured |
| FilterPaginationBenchmark | EricksonLopez | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 694,500 | 178,084 | measured |
| FilterPaginationBenchmark | RawSqlOffset | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 733,500 | 177,930 | measured |
| FilterPaginationBenchmark | Sieve | .NET 10.0.10 X64 RyuJIT x86-64-v4 | 742,000 | 64,020 | measured |
15. Release History & NuGet vs Repo Status#
Version lag detected: NuGet.org latest published version is v2.0.0, while local repository HEAD is at v3.0.0.
| Version | Source | Published Date | Summary |
|---|---|---|---|
| v2.0.0 ↗ | nuget | 2026-09-21 | Published EricksonLopez.Pagination 2.0.0 to NuGet.org. |
| v2.0.0 ↗ | github | 2026-09-21 | Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.Pagination.Abstractions` | `2.0.0` | | `EricksonLopez.Pagination` | `2.0.0` | | `EricksonLopez.Pagination.Analyzers` | `2.0.0` | | `EricksonLopez.Pagination.SourceGenerators` | `2.0.0` | | `EricksonLopez.Pagination.AspNetCore` | `2.0.0` | | `EricksonLopez.Pagination.Blazor` | `2.0.0` | | `EricksonLop... |
| v1.0.0 ↗ | github | 2026-08-25 | Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.Pagination.Abstractions` | `1.0.0` | | `EricksonLopez.Pagination` | `1.0.0` | | `EricksonLopez.Pagination.Analyzers` | `1.0.0` | | `EricksonLopez.Pagination.SourceGenerators` | `1.0.0` | | `EricksonLopez.Pagination.AspNetCore` | `1.0.0` | | `EricksonLopez.Pagination.Blazor` | `1.0.0` | | `EricksonLop... |
| v0.0.0-alpha.0 ↗ | nuget | 2026-08-25 | Published EricksonLopez.Pagination 0.0.0-alpha.0 to NuGet.org. |
16. Complementary & Related Libraries#
Libraries in the same tier, architectural layer, or directly paired via dependency edges.
17. Documentation, API Reference & Portal Links#
Conceptual Documentation (Starlight) →
Extracted XML API Reference →
17 namespaces · 119 types · 424 members
Ecosystem Dependency Map →
Learning Center & Handbook →
Per-library conceptual Starlight pages expand in M4; API Reference pages expand in M3.2.
18. Source Repository, License & Contributing#
Released under the MIT License. All assemblies follow EricksonLopez.* build invariants: explicit imports, strong-name signing (`EricksonLopez.snk`), and ASCII author metadata (`Erickson Lopez`).
19. Troubleshooting, Pitfalls & Migration Guidance#
- Provide a >= 32-byte UTF-8 secret key for HmacCursorEncoder in production; development mode logs a warning if omitted.
- Version lag detected: NuGet.org latest published version is v2.0.0, while local repository HEAD is at v3.0.0.
20. Quality & Verification Evidence#
- Strong-Name Signing (`EricksonLopez.snk`)
- EricksonLopez.snk
- `ImplicitUsings=disable`
- disable
- XML Documentation Extraction
- Verified (17 namespaces, 119 types, 424 members)
- MSBuild AOT / Trim Attributes
- 12 Full / 0 Partial / 3 Incompatible / 2 N/A
- BenchmarkDotNet Artifacts
- 438 total (435 measured, 3 na_error)
Explicit Verification Boundaries & Limitations
- All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).