EricksonLopez.Pagination

dotnet-pagination · Querying & Data

On this page (20 sections)

1. Identity, Tier & Maturity Profile#

L2 Cross-Cutting & ReliabilityStableMaintenance: ActiveAOT: PartialMIT LicenseConfidence: HIGH
ApplicationInfrastructurenet8.0net9.0net10.0

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
Also published in this family:
EricksonLopez.Pagination.AbstractionsEricksonLopez.Pagination.RelayEricksonLopez.Pagination.OpenApiEricksonLopez.Pagination.CosmosEricksonLopez.Pagination.EntityFrameworkCoreEricksonLopez.Pagination.Result

4. Verified Ecosystem Metrics#

v2.0.0
NuGet Published Version
v3.0.0
Repo HEAD Version
7,468
NuGet Downloads
17
Packable Packages
424
Public API Members
438
Benchmark Rows (RyuJIT)

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 IDStatusNuGet / LocalTFMsAOT StatusDownloadsDescription
EricksonLopez.PaginationPrimaryPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full1,712Zero-allocation pagination lists and core implementations.
EricksonLopez.Pagination.AbstractionsPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full1,978Standard pagination primitives and parameters interfaces.
EricksonLopez.Pagination.RelayPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full379GraphQL Relay Cursor Connections specification adapter for the EricksonLopez.Pagination ecosystem.
EricksonLopez.Pagination.OpenApiPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full259Swagger and OpenAPI pagination documentation extensions for the EricksonLopez.Pagination ecosystem.
EricksonLopez.Pagination.CosmosPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Incompatible257Azure Cosmos DB pagination extensions for the EricksonLopez.Pagination ecosystem.
EricksonLopez.Pagination.EntityFrameworkCorePublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full256Entity Framework Core async offset and keyset cursor pagination extensions for EricksonLopez.Pagination.
EricksonLopez.Pagination.ResultPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full254Result pattern integration extensions for EricksonLopez.Pagination.
EricksonLopez.Pagination.MongoDBPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Incompatible251MongoDB Driver offset and cursor pagination extensions for the EricksonLopez.Pagination ecosystem.
EricksonLopez.Pagination.ElasticsearchPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Incompatible250Elasticsearch 8.x search_after cursor pagination extensions for the EricksonLopez.Pagination ecosystem.
EricksonLopez.Pagination.LinqToDBPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full246LinqToDB async offset and keyset cursor pagination extensions for EricksonLopez.Pagination.
EricksonLopez.Pagination.GrpcPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full239gRPC protobuf message mappings and utilities for the EricksonLopez.Pagination ecosystem.
EricksonLopez.Pagination.DapperPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full238Dapper integration for EricksonLopez.Pagination. Provides offset and keyset pagination extension methods for IDbConnection.
EricksonLopez.Pagination.AspNetCorePublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full236ASP.NET Core Minimal APIs and MVC integration for EricksonLopez.Pagination.
EricksonLopez.Pagination.BlazorPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full226Headless Blazor pagination components for the EricksonLopez.Pagination ecosystem.
EricksonLopez.Pagination.RedisPublishedv2.0.0 / v3.0.0net8.0, net9.0, net10.0AOT: Full223Distributed Redis replay protection store for the EricksonLopez.Pagination ecosystem.
EricksonLopez.Pagination.SourceGeneratorsAnalyzer / GeneratorPublishedv2.0.0 / v3.0.0netstandard2.0AOT: N/A (Analyzer/Legacy)245Roslyn source generator for Native AOT cursor decoders in EricksonLopez.Pagination.
EricksonLopez.Pagination.AnalyzersAnalyzer / GeneratorPublishedv2.0.0 / v3.0.0netstandard2.0AOT: N/A (Analyzer/Legacy)219Roslyn 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#

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
EricksonLopez.Pagination Dependency Topology1 upstream library dependencies and 2 downstream dependent libraries verified in dependencies.json.
View accessible text summary and structure

1 upstream library dependencies and 2 downstream dependent libraries verified in dependencies.json.

DirectionLibraryTierRelationship Kinds
UpstreamEricksonLopez.ResultL0Adapter, NuGet Package
DownstreamEricksonLopez.DapperExtensionsL3Adapter, Compile-Time, NuGet Package
DownstreamEricksonLopez.SqlBuilderL3Adapter, 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_pagination

10. Target Frameworks & Native AOT / Trimming Matrix#

MSBuild `.csproj` inspection across 17 packages: 12 Full, 0 Partial, 3 Incompatible, 2 NotApplicable (analyzers/generators).

Package IDIsAotCompatibleEnableTrimAnalyzerVerified AOT StatusTarget Frameworks
EricksonLopez.PaginationtruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.AbstractionstruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.RelaytruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.OpenApitruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.CosmosfalsetrueIncompatiblenet8.0, net9.0, net10.0
EricksonLopez.Pagination.EntityFrameworkCoretruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.ResulttruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.MongoDBfalsetrueIncompatiblenet8.0, net9.0, net10.0
EricksonLopez.Pagination.ElasticsearchfalsetrueIncompatiblenet8.0, net9.0, net10.0
EricksonLopez.Pagination.LinqToDBtruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.GrpctruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.DappertruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.AspNetCoretruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.BlazortruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.RedistruetrueFullnet8.0, net9.0, net10.0
EricksonLopez.Pagination.SourceGeneratorsfalsenullNotApplicablenetstandard2.0
EricksonLopez.Pagination.AnalyzersfalsenullNotApplicablenetstandard2.0

11. Upstream Dependencies & Downstream Dependents#

Upstream Dependencies (1)

Downstream Dependents (2)

12. Optional Adapters & Third-Party Integrations#

Internal Adapter Edges & Integration Packages

Verified External NuGet Dependencies (18)

DapperDapper.StrongNameElastic.Clients.ElasticsearchGoogle.Protobuflinq2dbMicrosoft.AspNetCore.Components.WebMicrosoft.AspNetCore.OpenApiMicrosoft.Azure.CosmosMicrosoft.EntityFrameworkCoreMicrosoft.EntityFrameworkCore.RelationalMicrosoft.Extensions.DependencyInjectionMicrosoft.Extensions.DependencyInjection.AbstractionsMicrosoft.Extensions.Logging.AbstractionsMicrosoft.Extensions.OptionsMicrosoft.OpenApiMongoDB.DriverStackExchange.RedisSwashbuckle.AspNetCore.SwaggerGen

13. Configuration & DI Registration Summary#

Verified DI & Configuration Entry Points

  • PaginationEndpointExtensions.AddPaginationValidation

    Adds pagination validation endpoint filters to the route group builder.

  • PaginationServiceCollectionExtensions.AddPagination

    Registers pagination services, options validation, and MVC model binder providers in the service collection.

  • PaginationServiceCollectionExtensions.AddPaginationCursorEncoder

    Registers the default `ICursorEncoder` into the service collection.

  • PaginationBlazorServiceCollectionExtensions.AddPaginationBlazor

    Registers Blazor pagination UI options in the service collection.

  • CursorSqlBuilder.UseDialect

    Specifies the target SQL database dialect for query generation.

  • DapperKeysetBuilder<T>.UseDialect

    Inherits documentation from `CursorSqlBuilder.UseDialect`.

  • PaginationOpenApiOptionsExtensions.AddPaginationSupport

    Configures OpenAPI options to include pagination, filtering, and sorting parameter descriptions.

  • PaginationSwaggerGenOptionsExtensions.AddPaginationSupport

    Configures Swashbuckle options to include pagination, filtering, and sorting parameter descriptions.

  • RedisPaginationServiceCollectionExtensions.AddPaginationRedisReplayStore

    Registers `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).

Total rows: 438 · Measured: 435 · NA / Error: 3 · Suites: 8

Observed runtimes: .NET 10.0.10 X64 RyuJIT x86-64-v4

Observed CPUs: AMD Ryzen 7 9800X3D 4.70GHz, 1 CPU, 8 logical and 8 physical cores

SuiteMethodRuntimeMean (ns)Allocated (B)Status
CursorEncoderBenchmarksEncodeBase64.NET 10.0.10 X64 RyuJIT x86-64-v420.93128measured
CursorEncoderBenchmarksDecodeBase64.NET 10.0.10 X64 RyuJIT x86-64-v425.3796measured
FilterExpressionBenchmarksBuildExpression_Warm.NET 10.0.10 X64 RyuJIT x86-64-v429.05176measured
CursorEncoderBenchmarksEncodeHmac.NET 10.0.10 X64 RyuJIT x86-64-v4283.31768measured
CursorEncoderBenchmarksDecodeHmac.NET 10.0.10 X64 RyuJIT x86-64-v4416.24616measured
FilterExpressionBenchmarksBuildExpression_Cold.NET 10.0.10 X64 RyuJIT x86-64-v4851.561,968measured
OffsetPaginationBenchmarkEricksonLopez.NET 10.0.10 X64 RyuJIT x86-64-v4218,50028,600measured
OffsetPaginationBenchmarkRawSqlOffset.NET 10.0.10 X64 RyuJIT x86-64-v4228,50027,044measured
OffsetPaginationBenchmarkArdalis.NET 10.0.10 X64 RyuJIT x86-64-v4229,40025,354measured
OffsetPaginationBenchmarkRawSqlOffset.NET 10.0.10 X64 RyuJIT x86-64-v4231,60026,644measured
OffsetPaginationBenchmarkArdalis.NET 10.0.10 X64 RyuJIT x86-64-v4232,50026,900measured
OffsetPaginationBenchmarkEricksonLopez.NET 10.0.10 X64 RyuJIT x86-64-v4243,80028,252measured
OffsetPaginationBenchmarkSieve.NET 10.0.10 X64 RyuJIT x86-64-v4283,40034,560measured
OffsetPaginationBenchmarkSieve.NET 10.0.10 X64 RyuJIT x86-64-v4303,60034,171measured
FilterPaginationBenchmarkEricksonLopez.NET 10.0.10 X64 RyuJIT x86-64-v4307,80038,554measured
FilterPaginationBenchmarkRawSqlOffset.NET 10.0.10 X64 RyuJIT x86-64-v4315,70039,885measured
FilterPaginationBenchmarkArdalis.NET 10.0.10 X64 RyuJIT x86-64-v4318,50037,325measured
OffsetPaginationBenchmarkRawSqlOffset.NET 10.0.10 X64 RyuJIT x86-64-v4485,400125,829measured
OffsetPaginationBenchmarkArdalis.NET 10.0.10 X64 RyuJIT x86-64-v4526,700124,037measured
OffsetPaginationBenchmarkEricksonLopez.NET 10.0.10 X64 RyuJIT x86-64-v4556,400129,198measured
OffsetPaginationBenchmarkSieve.NET 10.0.10 X64 RyuJIT x86-64-v4566,500133,243measured
FilterPaginationBenchmarkArdalis.NET 10.0.10 X64 RyuJIT x86-64-v4677,000175,196measured
FilterPaginationBenchmarkEricksonLopez.NET 10.0.10 X64 RyuJIT x86-64-v4694,500178,084measured
FilterPaginationBenchmarkRawSqlOffset.NET 10.0.10 X64 RyuJIT x86-64-v4733,500177,930measured
FilterPaginationBenchmarkSieve.NET 10.0.10 X64 RyuJIT x86-64-v4742,00064,020measured

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.

VersionSourcePublished DateSummary
v2.0.0 ↗nuget2026-09-21Published EricksonLopez.Pagination 2.0.0 to NuGet.org.
v2.0.0 ↗github2026-09-21Ecosystem 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 ↗github2026-08-25Ecosystem 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 ↗nuget2026-08-25Published EricksonLopez.Pagination 0.0.0-alpha.0 to NuGet.org.

Libraries in the same tier, architectural layer, or directly paired via dependency edges.

17. Documentation, API Reference & Portal Links#

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).

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.