LinqPaginator 1.2.1
See the version list below for details.
dotnet add package LinqPaginator --version 1.2.1
NuGet\Install-Package LinqPaginator -Version 1.2.1
<PackageReference Include="LinqPaginator" Version="1.2.1" />
paket add LinqPaginator --version 1.2.1
#r "nuget: LinqPaginator, 1.2.1"
// Install LinqPaginator as a Cake Addin #addin nuget:?package=LinqPaginator&version=1.2.1 // Install LinqPaginator as a Cake Tool #tool nuget:?package=LinqPaginator&version=1.2.1
Linq Paginator
Retrieve collection results from IQueryable<T>
, IEnumerable<T>
or any array based data type that inherits ICollection<T>
and packages the results into pages for easy fetching to enable lazy loading data on UI components in a fast way when pulling large sets of data.
Install
Install package from Nuget by running the following command in Package Manager Console.
Install-Package LinqPaginator -Version 1.0.6
Then go ahead add a using statement to reference the already downloaded package.
using LinqPaginator;
This library works with almost all arrays that inherit from ICollection<T>
and it provides an extension method to paginate your collection as shown below passing a page number and the number of items to return per page.
Sample Data:
IList<string> _names = new List<string>();
_names.Add("Test-01");
_names.Add("Test-02");
_names.Add("Test-03");
_names.Add("Test-04");
_names.Add("Test-05");
Usage
You can use either of the methods.
PagedResult<string> result = _names.Page(page: 1, perpage: 2);
PagedResult<string> result = _names.Paged(page: 1, perpage: 2);
PagedResult<string> result = _names.Paginate(page: 1, perpage: 2);
PagedResult<string> result = _names.ToPages(page: 1, perpage: 2);
PagedResult<string> result = _names.ToPaginate(page: 1, perpage: 2);
Result Model
public struct PagedResult<T>
{
/// <summary>
/// Current page in pagination
/// </summary>
public int Page { get; set; }
/// <summary>
/// Total number of items in every page as per
/// pagination request. Defaults to 10.
/// </summary>
public int ItemsPerPage { get; set; }
/// <summary>
/// Number of pages used to paginate our <see cref="List"/> with
/// each page containing (x) <see cref="ItemsPerPage"/>
/// </summary>
public int TotalPages { get; set; }
/// <summary>
/// Number of items matching your pagination request
/// </summary>
public int TotalItems { get; set; }
/// <summary>
/// Array containing items in the current page
/// </summary>
public T[] List { get; set; }
}
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 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. |
.NET Core | netcoreapp2.0 is compatible. netcoreapp2.1 is compatible. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net46 is compatible. net461 is compatible. net462 is compatible. 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. |
-
.NETCoreApp 2.0
- Shared.Common (>= 1.1.9)
-
.NETCoreApp 2.1
- Shared.Common (>= 1.1.9)
-
.NETFramework 4.6
- Shared.Common (>= 1.1.9)
-
.NETFramework 4.6.1
- Shared.Common (>= 1.1.9)
-
.NETFramework 4.6.2
- Shared.Common (>= 1.1.9)
-
.NETStandard 2.0
- Shared.Common (>= 1.1.9)
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.2.7 | 758 | 3/16/2021 | |
1.2.6 | 2,468 | 10/5/2020 | |
1.2.5 | 523 | 9/28/2020 | |
1.2.4 | 589 | 3/4/2020 | |
1.2.3 | 639 | 9/7/2019 | |
1.2.2 | 569 | 9/6/2019 | |
1.2.1 | 535 | 9/6/2019 | |
1.2.0 | 579 | 9/6/2019 | |
1.1.0 | 607 | 7/24/2019 | |
1.1.0-beta | 425 | 6/26/2019 | |
1.0.6 | 609 | 4/14/2019 | |
1.0.5 | 641 | 2/17/2019 | |
1.0.4 | 646 | 2/9/2019 | |
1.0.3 | 684 | 2/6/2019 | |
1.0.2 | 1,168 | 3/3/2018 | |
1.0.1 | 941 | 3/2/2018 | |
1.0.0 | 1,118 | 1/21/2018 |
Fixes bug/issue with pagination result:
-> TotalPages is always zero