Pandorax.PagedList
1.0.0
dotnet add package Pandorax.PagedList --version 1.0.0
NuGet\Install-Package Pandorax.PagedList -Version 1.0.0
<PackageReference Include="Pandorax.PagedList" Version="1.0.0" />
paket add Pandorax.PagedList --version 1.0.0
#r "nuget: Pandorax.PagedList, 1.0.0"
// Install Pandorax.PagedList as a Cake Addin #addin nuget:?package=Pandorax.PagedList&version=1.0.0 // Install Pandorax.PagedList as a Cake Tool #tool nuget:?package=Pandorax.PagedList&version=1.0.0
Pandorax.PagedList
Pandorax.PagedList
is a lightweight library for handling paginated data in C# applications. It provides easy-to-use extension methods for IEnumerable<T>
to simplify working with paginated data.
Installation
You can install the library via NuGet:
Install-Package Pandorax.PagedList
Features
- Extension methods to create paginated lists from any
IEnumerable<T>
. - Easy-to-use API with minimal configuration.
- Useful for building pagination functionality in web applications, APIs, or any project where data paging is required.
Usage
Example: Converting an IEnumerable<T>
to a Paged List
The library provides an extension method, ToPagedList<T>
, which creates a paged list from an IEnumerable<T>
.
using System;
using System.Collections.Generic;
using Pandorax.PagedList;
class Program
{
static void Main()
{
IEnumerable<int> numbers = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int pageIndex = 1; // Page number (1-based index)
int pageSize = 3; // Number of items per page
var pagedList = numbers.ToPagedList(pageIndex, pageSize);
Console.WriteLine($"Page {pageIndex} of {pagedList.TotalPages}");
foreach (var number in pagedList)
{
Console.WriteLine(number);
}
}
}
IPagedList<T> Interface
The IPagedList<T>
interface includes properties and methods to work with paginated data:
int PageIndex
: The current page index (0-based).int PageSize
: The number of items per page.int Count
: The number of items contained on this page.int TotalItemCount
: The total number of items.int TotalPageCount
: The total number of pages.bool HasPreviousPage
: Indicates if there is a previous page.bool HasNextPage
: Indicates if there is a next page.bool IsFirstPage
: Indicates if this page is the first page.bool IsLastPage
: Indicates if this page is the last page.
Requirements
- .NET 8.0 or higher.
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests to improve the library.
License
This project is licensed under the MIT License.
Support
For questions or support, please create an issue in the GitHub repository.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | 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. |
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Pandorax.PagedList:
Package | Downloads |
---|---|
Pandorax.PagedList.EntityFrameworkCore
A helper library for Pandorax.PagedList to generate paged lists asynchronously using EntityFrameworkCore |
|
Pandorax.PagedList.EntityFramework
A paged list utility designed for .NET |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 84 | 2/13/2025 |
1.0.0-alpha001 | 280 | 11/29/2024 |
0.0.0-alpha4 | 759 | 6/27/2023 |
0.0.0-alpha3 | 132 | 6/27/2023 |
0.0.0-alpha2 | 694 | 6/13/2022 |
0.0.0-alpha1 | 478 | 6/14/2021 |