EricksonLopez.Pagination Overview
EricksonLopez.Pagination (2.0.0 on NuGet, L2) delivers keyset (CursorPagedList<T>) and offset (PagedList<T>) pagination with tamper-evident HmacCursorEncoder, replay protection (ICursorReplayStore / Redis), and multi-backend adapters consumed by EricksonLopez.DapperExtensions and EricksonLopez.SqlBuilder.
- Constant-time keyset pagination: Avoids
OFFSET Ntable scans on deep pages (DeepOffsetWarningThreshold = 1000). - Cryptographic cursor integrity:
HmacCursorEncodersigns cursors with >= 32-byte UTF-8 secrets, optional TTL (timeToLive),clockSkewTolerance, tenant binding (tenantContextProvider), and one-time replay prevention (ICursorReplayStore). - Explicit error mapping (
EricksonLopez.Pagination.Result):InvalidCursor,ExpiredCursor, andReplayedCursormap cleanly intoResult<T>outcomes.
Rendering diagram…
flowchart LR Req["CursorPaginationParameters (First/After)"] --> Dec["HmacCursorEncoder (Verify HMAC + TTL + Replay)"] Dec -- Invalid/Expired --> Err["PaginationErrors (Result.Failure)"] Dec -- Valid --> Query["KeysetBuilder / DapperKeysetBuilder"] Query --> Out["CursorPagedList<T> + Signed NextCursor"]
View accessible text summary and structure
CursorPaginationParameters enters HmacCursorEncoder to validate signature, TTL, tenant, and replay store, drives DapperKeysetBuilder or EF Core KeysetBuilder, and emits CursorPagedList<T>.
flowchart LR
Req["CursorPaginationParameters (First/After)"] --> Dec["HmacCursorEncoder (Verify HMAC + TTL + Replay)"]
Dec -- Invalid/Expired --> Err["PaginationErrors (Result.Failure)"]
Dec -- Valid --> Query["KeysetBuilder / DapperKeysetBuilder"]
Query --> Out["CursorPagedList<T> + Signed NextCursor"]Package Roster & Native AOT Status (17 / 17 Published)
Section titled “Package Roster & Native AOT Status (17 / 17 Published)”All 17 packages are published at 2.0.0 on NuGet (7,468 total downloads; localVersion: 3.0.0 on disk). Overall AOT status is Partial (12 Full, 3 Incompatible, 2 NotApplicable):
FullAOT (12,net8.0;net9.0;net10.0):Pagination(1,712dl),Abstractions(1,978dl),AspNetCore,Blazor,Dapper,EntityFrameworkCore(*.csproj inheritsIsAotCompatible=true, thoughToCursorPagedListAsyncremarks noteExpression.Compile()),Grpc,LinqToDB,OpenApi,Redis,Relay,Result.IncompatibleAOT (3,net8.0;net9.0;net10.0):Cosmos,Elasticsearch,MongoDB(IsAotCompatible=false).NotApplicable(2,netstandard2.0):Analyzers(PAG002–PAG008),SourceGenerators(CursorDecoderGenerator,FilterProviderGenerator).
Measured directly from BenchmarkDotNet.Artifacts (438 total rows: 435 measured, 3 na_error across 8 suites on .NET 10.0.10 X64 RyuJIT x86-64-v4; no NativeAOT reports):
CursorEncoderBenchmarks.EncodeBase64: 20.93 ns / 128 B (DecodeBase64: 25.37 ns / 96 B)CursorEncoderBenchmarks.EncodeHmac: 283.31 ns / 768 B (DecodeHmac: 416.24 ns / 616 B)EFCoreBenchmarks.WarmStart_Keyset: 1,351,000 ns (1.351 ms) / 48,302 B vsWarmStart_Offset: 1,762,000 ns (1.762 ms) / 44,339 BEFCoreDeepPaginationBenchmarks.Keyset_Stability: 2,619,000 ns (2.619 ms) / 55,460 Bna_errordisclosure (3rows):EFCoreDeepPaginationBenchmarks.Offset_Degradation(TargetPage=1, 100, 10000) recordedMean = NAin the benchmark artifact and is excluded from averages.