Naravel.Pagination
0.2.0
dotnet add package Naravel.Pagination --version 0.2.0
NuGet\Install-Package Naravel.Pagination -Version 0.2.0
<PackageReference Include="Naravel.Pagination" Version="0.2.0" />
<PackageVersion Include="Naravel.Pagination" Version="0.2.0" />
<PackageReference Include="Naravel.Pagination" />
paket add Naravel.Pagination --version 0.2.0
#r "nuget: Naravel.Pagination, 0.2.0"
#:package Naravel.Pagination@0.2.0
#addin nuget:?package=Naravel.Pagination&version=0.2.0
#tool nuget:?package=Naravel.Pagination&version=0.2.0
Naravel.Pagination
Laravel-style pagination results for .NET: length-aware, simple and cursor pages with Laravel's data/links/meta JSON. No EF Core, ASP.NET Core or database dependency.
| Fact | Detail |
|---|---|
| Install | dotnet add package Naravel.Pagination |
| Targets | .NET 10 |
| Needs | No other package: no EF Core, ASP.NET Core or database dependency |
| Add-on | Naravel.Pagination.EntityFrameworkCore fills a page from an EF Core query |
What you get
- Laravel-shaped pages. System.Text.Json writes a page as
data,linksandmeta. - Three kinds of page. Length-aware
Paginated<T>,SimplePaginated<T>and cursorCursorPaginated<T>. - Convert and decorate.
Mapconverts the items and keeps the page information;WithPathandWithQueryset the links,WithQueryadding the other query-string values. - Cursor paging without drift. With the EF Core adapter you declare the sort keys once and the helper writes both the
ORDER BYand theWHERE. - No dependencies. Your own code reads the rows; this package only describes the page.
Quick start
using Naravel.Pagination;
// Your own code reads one page of rows and the total number of rows; this package describes the page.
IReadOnlyList<string> rows = ["Ada", "Grace"];
var page = new Paginated<string>(rows, 25, 1, 2).WithPath("/people"); // items, total, current page, per page
// Results is ASP.NET Core, not part of this package. System.Text.Json writes the page as data, links and meta.
app.MapGet("/people", () => Results.Ok(page));
Paginated<T> exposes Items, Total, CurrentPage, PerPage and LastPage. SimplePaginated<T> has no total and CursorPaginated<T> pages by a cursor; the guide describes both.
Related packages
| Package | Adds |
|---|---|
Naravel.Pagination.EntityFrameworkCore |
PaginateAsync, SimplePaginateAsync and CursorPaginateAsync for EF Core queries; the cursor keys are declared once and drive both the order and the filter |
Learn more
- Pagination: English guide
- Changelog · Source and issues · MIT license
Part of Naravel: Laravel's names, .NET's type system. All Naravel packages share one version.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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. |
-
net10.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Naravel.Pagination:
| Package | Downloads |
|---|---|
|
Naravel.Database
Laravel-style query builder for Naravel on ADO.NET and Dapper: named connections on Naravel.Foundation, a connection and transaction seam that EF Core can share, and per-database driver packages. |
|
|
Naravel.Pagination.EntityFrameworkCore
PaginateAsync, SimplePaginateAsync and CursorPaginateAsync for EF Core queries, returning Naravel.Pagination results. Keyset (cursor) paging applies both the order and the filter from one key declaration. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Release notes: https://github.com/km-arc/Naravel/releases/tag/v0.2.0 - full history: https://github.com/km-arc/Naravel/blob/main/CHANGELOG.md