Tolitech.CodeGenerator.Pagination
1.0.0-alpha-2
dotnet add package Tolitech.CodeGenerator.Pagination --version 1.0.0-alpha-2
NuGet\Install-Package Tolitech.CodeGenerator.Pagination -Version 1.0.0-alpha-2
<PackageReference Include="Tolitech.CodeGenerator.Pagination" Version="1.0.0-alpha-2" />
paket add Tolitech.CodeGenerator.Pagination --version 1.0.0-alpha-2
#r "nuget: Tolitech.CodeGenerator.Pagination, 1.0.0-alpha-2"
// Install Tolitech.CodeGenerator.Pagination as a Cake Addin #addin nuget:?package=Tolitech.CodeGenerator.Pagination&version=1.0.0-alpha-2&prerelease // Install Tolitech.CodeGenerator.Pagination as a Cake Tool #tool nuget:?package=Tolitech.CodeGenerator.Pagination&version=1.0.0-alpha-2&prerelease
Tolitech.CodeGenerator.Pagination
Pagination library used in projects created by the Code Generator tool.
This project allows simplifying the use and return of paginated lists either by using an ORM as Entity Framework Core, or by simply using lists with LINQ.
Tolitech Code Generator Tool: http://www.tolitech.com.br
Examples:
public class Person
{
public Person(string name)
{
Name = name;
}
public string Name { get; private set; }
}
var people = new List<Person>();
for (int i = 0; i < 50; i++)
{
people.Add(new Person($"Person {i}"));
}
var items = people.Skip(0).Take(10).ToList();
var paginated = new PaginatedList<Person>(items, people.Count, 1, 10);
var paginated = new PaginatedList<Person>(people, 5, 10);
bool b1 = paginated.First().Name == "Person 40"); // this is true
bool b2 = paginated.Last().Name == "Person 49"); // this is true
var paginatedList = new PaginatedList<Person>(people, 5, 10);
var paginated = new Paginated<Person>(paginatedList, 5);
bool b1 = paginated.HasPreviousPage == true; // this is true
bool b2 = paginated.HasNextPage == false; // this is true
bool b3 = paginated.IsFirstPage == false; // this is true
bool b4 = paginated.IsLastPage == true; // this is true
bool b5 = paginated.FirstItemOnPage == 41; // this is true
bool b6 = paginated.LastItemOnPage == 50; // this is true
Other Usage Properties:
- HasPreviousPage
- HasNextPage
- IsFirstPage
- IsLastPage
Check the unit tests to learn about other exposed properties and various possibilities for use.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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 was computed. 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. |
-
net6.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Tolitech.CodeGenerator.Pagination:
Package | Downloads |
---|---|
Tolitech.CodeGenerator.AspNetCore
AspNetCore library for Tolitech Code Generator. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0-alpha-2 | 5,275 | 11/24/2021 |
1.0.0-alpha-1 | 165 | 11/19/2021 |
More information at http://www.tolitech.com.br/