Canducci.Pagination
3.3.0
dotnet add package Canducci.Pagination --version 3.3.0
NuGet\Install-Package Canducci.Pagination -Version 3.3.0
<PackageReference Include="Canducci.Pagination" Version="3.3.0" />
<PackageVersion Include="Canducci.Pagination" Version="3.3.0" />
<PackageReference Include="Canducci.Pagination" />
paket add Canducci.Pagination --version 3.3.0
#r "nuget: Canducci.Pagination, 3.3.0"
#:package Canducci.Pagination@3.3.0
#addin nuget:?package=Canducci.Pagination&version=3.3.0
#tool nuget:?package=Canducci.Pagination&version=3.3.0
Canducci Paginated
Note: based on repository https://github.com/TroyGoode/PagedList
Canducci Paginated
Canducci Paginated Mvc
Installation
- Canducci.Pagination
PM> Install-Package Canducci.Pagination
- Canducci.Pagination.Mvc
PM> Install-Package Canducci.Pagination.Mvc
Note:
Installing the package Canducci.Pagination.Mvc already integrates the package Canducci.Pagination.
How to use
Examples
- IQueryable
Entity Framework
static void TestIQueryablePaginated(int current, int total = 5)
{
using (DatabaseContext db = new DatabaseContext())
{
Paginated<People> listOfQueryable0 =
db.People
.OrderBy(x => x.Name)
.ToPaginated(current, total);
}
}
- IEnumerable
StaticPaginated
public class People
{
public int Id { get; set; }
public string Name { get; set; }
}
public class PeopleList: List<People>
{
public PeopleList()
{
Add(new People { Id = 1, Name = "Test 1" });
Add(new People { Id = 2, Name = "Test 2" });
Add(new People { Id = 3, Name = "Test 3" });
Add(new People { Id = 4, Name = "Test 4" });
Add(new People { Id = 5, Name = "Test 5" });
Add(new People { Id = 6, Name = "Test 6" });
Add(new People { Id = 7, Name = "Test 7" });
Add(new People { Id = 8, Name = "Test 8" });
Add(new People { Id = 9, Name = "Test 9" });
Add(new People { Id = 10, Name = "Test 10" });
}
}
static void TestIEnumerableStaticPaginated(int current, int total = 5)
{
PeopleList listOfAllPeople = new PeopleList();
int countOfPeople = listOfAllPeople.Count;
IEnumerable<People> listOfPeople0 = listOfAllPeople
.OrderBy(x => x.Id)
.Skip((current - 1) * total)
.Take(total)
.ToArray();
StaticPaginated<People> paginated0 =
new StaticPaginated<People>(
listOfPeople0,
current,
total,
countOfPeople);
}
Mvc - Entity Framework with HtmlHelpers e TagHelpers
- Controller
using Canducci.Pagination;
public class HomeController : Controller
{
public DatabaseContext Database { get; }
public HomeController(DatabaseContext database)
{
Database = database;
}
public IActionResult Index(int? current)
{
var result = Database.People.OrderBy(x => x.Id).ToPaginated(current ?? 1, 3);
return View(result);
}
}
- View - Configuration (_ViewImports.cshtml)
Open the file _ViewImports.cshtml and add this line @addTagHelper *, Canducci.Pagination.Mvc and in the same file add @using Canducci.Pagination.Mvc, resume:
@using Canducci.Pagination.Mvc
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Canducci.Pagination.Mvc
- View - Index.cshtml
@model Canducci.Pagination.Paginated<People>
@{ ViewData["Title"] = "Home Page"; }
@foreach (var item in Model)
{
<div>@item.Id - @item.Name</div>
}
<div>
@Html.Pagination(
Model,
current => Url.Action("Index", new { current }),
PaginatedStyle.PreviousNext,
new PaginatedOptions {
NextLabel = "Next",
PreviousLabel = "Previous",
FirstLabel = "First",
LastLabel = "Last"
}
)
</div>
<div>
@Html.Pagination(
Model,
current => Url.Action("Index", new { current }),
PaginatedStyle.FirstPreviousNextLast,
new PaginatedOptions {
NextLabel = "Next",
PreviousLabel = "Previous",
FirstLabel = "First",
LastLabel = "Last"
}
)
</div>
<div>
@Html.Pagination(
Model,
current => Url.Action("Index", new { current }),
PaginatedStyle.Numbers,
new PaginatedOptions {
NextLabel = "Next",
PreviousLabel = "Previous",
FirstLabel = "First",
LastLabel = "Last"
}
)
</div>
<div>
@Html.Pagination(
Model,
current => Url.Action("Index", new { current}),
PaginatedStyle.NumbersWithPreviousNext,
new PaginatedOptions {
NextLabel = "Next",
PreviousLabel = "Previous",
FirstLabel = "First",
LastLabel = "Last"
}
)
</div>
<div>
@Html.Pagination(
Model,
current => Url.Action("Index", new { current }),
PaginatedStyle.NumbersWithFirstPreviousNextLast,
new PaginatedOptions {
NextLabel = "Next",
PreviousLabel = "Previous",
FirstLabel = "First",
LastLabel = "Last"
}
)
</div>
<h3>TagHelper</h3>
<div>
<pagination pagination-asp-action="Index"
pagination-asp-controller="Home"
pagination-style="PreviousNext"
pagination-css-class-ul="pagination"
pagination-paginated="Model"
pagination-label-next="Next"
pagination-label-previous="Previous"
pagination-css-class-anchor="page-link"
pagination-css-class-li="page-item"
pagination-css-class-li-disabled="disabled">
</pagination>
</div>
<div>
<pagination pagination-asp-action="Index"
pagination-asp-controller="Home"
pagination-style="FirstPreviousNextLast"
pagination-css-class-ul="pagination"
pagination-paginated="Model"
pagination-label-next="Next"
pagination-label-previous="Previous"
pagination-label-first="First"
pagination-label-last="Last"
pagination-css-class-anchor="page-link"
pagination-css-class-li="page-item"
pagination-css-class-li-disabled="disabled">
</pagination>
</div>
<div>
<pagination pagination-asp-action="Index"
pagination-asp-controller="Home"
pagination-style="Numbers"
pagination-css-class-li-active="active"
pagination-css-class-ul="pagination"
pagination-paginated="Model"
pagination-label-next="Next"
pagination-label-previous="Previous"
pagination-label-first="First"
pagination-label-last="Last"
pagination-css-class-anchor="page-link"
pagination-css-class-li="page-item"
pagination-css-class-li-disabled="disabled">
</pagination>
</div>
<div>
<pagination pagination-asp-action="Index"
pagination-asp-controller="Home"
pagination-style="NumbersWithPreviousNext"
pagination-css-class-li-active="active"
pagination-css-class-ul="pagination"
pagination-paginated="Model"
pagination-label-next="Next"
pagination-label-previous="Previous"
pagination-label-first="First"
pagination-label-last="Last"
pagination-css-class-anchor="page-link"
pagination-css-class-li="page-item"
pagination-css-class-li-disabled="disabled">
</pagination>
</div>
<div>
<pagination pagination-asp-action="Index"
pagination-asp-controller="Home"
pagination-style="NumbersWithFirstPreviousNextLast"
pagination-css-class-li-active="active"
pagination-css-class-ul="pagination"
pagination-paginated="Model"
pagination-label-next="Next"
pagination-label-previous="Previous"
pagination-label-first="First"
pagination-label-last="Last"
pagination-css-class-anchor="page-link"
pagination-css-class-li="page-item"
pagination-css-class-li-disabled="disabled">
</pagination>
</div>
<div>
<pagination pagination-asp-action="Index"
pagination-asp-controller="Home"
pagination-style="NumbersWithFirstPreviousNextLast"
pagination-paginated="Model"
pagination-label-next="Next"
pagination-label-previous="Previous">
</pagination>
</div>
Razor Pages
- PageModel Peoples
using System.Linq;
using Canducci.Pagination;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace Canducci.WebAppRazorPages.Test.Pages
{
public class PeoplesModel : PageModel
{
private readonly DatabaseContext Context;
public PeoplesModel(DatabaseContext context)
{
Context = context;
}
public Paginated<People> Items { get; private set; }
public void OnGet(int? current)
{
Items = Context.People
.OrderBy(x => x.Name)
.ThenBy(x => x.Id)
.ToPaginated(current ?? 1, 4);
}
}
}
- View Peoples
@page "page-{current=1}"
@model PeoplesModel
<br />
<table class="table table-striped">
<thead>
<tr>
<th style="width:5%">Id</th>
<th style="width:95%">Name</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Items)
{
<tr>
<td>@item.Id</td>
<td>@item.Name</td>
</tr>
}
</tbody>
<tfoot>
<tr>
<td colspan="2" class="text-center">
<pagination pagination-asp-page="Peoples"
pagination-asp-page-handler="page-{current=1}"
pagination-style="NumbersWithFirstPreviousNextLast"
pagination-css-class-li-active="active"
pagination-css-class-ul="pagination pagination-sm"
pagination-paginated="Model.Items"
pagination-label-next="Próximo"
pagination-label-previous="Anterior"
pagination-label-first="Primeiro"
pagination-label-last="Último"
pagination-css-class-anchor="page-link"
pagination-css-class-li="page-item"
pagination-css-class-li-disabled="disabled"
pagination-total-pages="true"
pagination-label-total-pages="página(s).">
</pagination>
</td>
</tr>
<tr>
<td colspan="2" class="text-center">
@Html.Pagination(
Model.Items,
current => Url.Page("Peoples", new { current }),
PaginatedStyle.NumbersWithFirstPreviousNextLast,
new PaginatedOptions {
NextLabel = "Next",
PreviousLabel = "Previous",
FirstLabel = "First",
LastLabel = "Last"
}
)
</td>
</tr>
</tfoot>
</table>
Example Pagination

| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. 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 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Canducci.Pagination:
| Package | Downloads |
|---|---|
|
Canducci.Pagination.Mvc
Pagination Razor Pages and Traditional MVC |
|
|
ENT.Framework
Contact for support: eduardo@entechnology.com.br |
|
|
Canducci.MongoDB.Repository
MongoDB repository with asynchronous operations and Canducci pagination support |
|
|
FwLux.Backend
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.3.0 | 3,915 | 6/5/2026 |
| 3.2.0 | 1,281 | 12/14/2025 |
| 3.1.0 | 22,876 | 10/21/2024 |
| 3.0.0 | 44,553 | 1/15/2023 |
| 2.1.2 | 45,222 | 12/31/2020 |
| 2.1.1 | 1,744 | 8/20/2020 |
| 2.1.0 | 1,378 | 8/19/2020 |
| 2.0.0 | 1,366 | 12/22/2019 |
| 1.0.3.1 | 2,641 | 4/16/2018 |
| 1.0.3 | 2,237 | 4/13/2018 |
| 1.0.2 | 2,568 | 4/11/2018 |
| 1.0.1 | 1,965 | 4/11/2018 |
| 1.0.0 | 1,922 | 4/10/2018 |