SmartPagination 1.0.0
dotnet add package SmartPagination --version 1.0.0
NuGet\Install-Package SmartPagination -Version 1.0.0
<PackageReference Include="SmartPagination" Version="1.0.0" />
<PackageVersion Include="SmartPagination" Version="1.0.0" />
<PackageReference Include="SmartPagination" />
paket add SmartPagination --version 1.0.0
#r "nuget: SmartPagination, 1.0.0"
#:package SmartPagination@1.0.0
#addin nuget:?package=SmartPagination&version=1.0.0
#tool nuget:?package=SmartPagination&version=1.0.0
๐ฆ SmartPagination
๐ A unified pagination engine for .NET APIs (Offset, Cursor, Smart Auto Selection)
SmartPagination is a lightweight, production-ready library that simplifies pagination across your .NET applications using a single, consistent API.
โจ Features
๐ Offset Pagination (page-based)
โก Cursor Pagination (high-performance for large datasets)
๐ง Smart Auto Pagination (SmartPaginateAsync)
๐ Plug & Play with IQueryable<T>
โ๏ธ Works seamlessly with EF Core
๐งฉ Clean and minimal API
๐ซ No Dynamic LINQ dependency
๐ฆ Installation
dotnet add package SmartPagination
๐ Quick Start
Basic Usage (Recommended)
var result = await db.Users
.OrderBy(x โ x.Id)
.SmartPaginateAsync(new PaginationRequest
{
PageSize = 10
});
Offset Pagination
var result = await db.Users
.OrderBy(x โ x.Id)
.SmartPaginateAsync(new PaginationRequest
{
PageNumber = 1,
PageSize = 10
});
Cursor Pagination
var result = await db.Users
.OrderBy(x โ x.Id)
.SmartPaginateAsync(new PaginationRequest
{
Cursor = "25",
PageSize = 10
});
๐ง How Smart Pagination Works
SmartPagination automatically selects the best strategy:
Condition Strategy
PageNumber provided Offset
Cursor provided Cursor
No OrderBy Cursor (safe fallback)
Default Offset
๐ Response Model
public class PagedResult<T>
{
public List<T> Items { get; set; }
public int? PageNumber { get; set; }
public string? NextCursor { get; set; }
public bool HasNextPage { get; set; }
}
โ๏ธ Pagination Request
public class PaginationRequest
{
public int PageSize { get; set; } = 10;
public int? PageNumber { get; set; }
public string? Cursor { get; set; }
public PaginationType Type { get; set; }
}
๐งช Example: ASP.NET Core API
[HttpGet]
public async Task<IActionResult> GetUsers(int page = 1)
{
var result = await _db.Users
.OrderBy(x โ x.Id)
.SmartPaginateAsync(new PaginationRequest
{
PageNumber = page,
PageSize = 10
});
return Ok(result);
}
โก Supported Strategies
๐ Offset Pagination
Best for:
Admin dashboards
Reports
Small datasets
โก Cursor Pagination
Best for:
Infinite scroll
Activity feeds
Large datasets
๐ง Smart Pagination (Recommended)
Best for:
APIs with mixed usage
Unknown scale requirements
Automatic performance optimization
๐๏ธ Requirements
.NET 6 / .NET 7 / .NET 8 / .NET 9
Works with IQueryable<T>
EF Core (optional but recommended)
๐ฅ Why SmartPagination?
โ Without it
Rewriting pagination logic every project
Poor performance with large datasets
Inconsistent API behavior
โ With it
One consistent pagination API
Automatic strategy selection
Better scalability
Cleaner codebase
๐ Roadmap
Seek Pagination (multi-column cursor)
Fluent API (.Paginate().WithCursor())
Performance benchmarking
Caching support
Diagnostics / logging
๐ค Contributing
Contributions are welcome!
Focus areas:
Performance improvements
EF Core optimizations
Developer experience
๐ License
MIT License
โญ Support
If this package helps you, consider giving it a star โญ on GitHub.
๐ Final Note
Pagination should be solved once โ not in every project.
SmartPagination helps you do exactly that.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 was computed. 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. |
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 106 | 4/13/2026 |