Lunavex.EFCore.Pagination 8.0.1

dotnet add package Lunavex.EFCore.Pagination --version 8.0.1                
NuGet\Install-Package Lunavex.EFCore.Pagination -Version 8.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Lunavex.EFCore.Pagination" Version="8.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Lunavex.EFCore.Pagination --version 8.0.1                
#r "nuget: Lunavex.EFCore.Pagination, 8.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Lunavex.EFCore.Pagination as a Cake Addin
#addin nuget:?package=Lunavex.EFCore.Pagination&version=8.0.1

// Install Lunavex.EFCore.Pagination as a Cake Tool
#tool nuget:?package=Lunavex.EFCore.Pagination&version=8.0.1                

Lunavex.EFCore.Pagination NuGet Package

Overview

The Lunavex.EFCore.Pagination package provides a solution for paginating database queries in EF Core applications. It offers a streamlined method to manage large datasets by breaking them into smaller, manageable chunks. This library focuses on simplifying pagination implementation, ensuring efficient data retrieval while maintaining response consistency in .NET applications.

Features

  • Generic Pagination Result: Implements a generic pagination result type, allowing for flexible handling of paginated data retrieval operations across diverse data structures.
  • Configurable Page Size: Supports customizable page sizes, enabling developers to adjust the amount of data fetched per page according to application requirements.
  • Simplified Pagination Logic: Offers a straightforward pagination logic, abstracting away the complexity of calculating page numbers and total pages, ensuring ease of use.

Getting Started

Installation

To integrate Lunavex.EFCore.Pagination into your project, install it via the NuGet package manager:

Install-Package Lunavex.EFCore.Pagination

Or through the .NET CLI:

dotnet add package Lunavex.EFCore.Pagination

Usage

  • For successful pagination, instantiate a PageResult object with the retrieved data:
public async Task<PageResult<T>> GetAllAsync(PaginationRequestDto request)
{
    PageResult<T> product= await _context.Products.ToPagedListAsync(request.PageNumber, request.PageSize);
    return product;
}
public sealed record PaginationRequestDto(
    int PageNumber = 1,
    int PageSize = 10,
    );
  • Result :
{
  "datas": [
    {
      "id": 1,
      "name": "Product",
      "price": 20
    },
    ...
  ],
  "pageNumber": 1,
  "pageSize": 10,
  "totalPages": 18,
  "isFirstPage": true,
  "isLastPage": false
}

Contributing

We welcome contributions! Feel free to open an issue or submit a pull request on our GitHub repository for any suggestions or improvements.

License

Lunavex.EFCore.Pagination is licensed under the MIT License. See the LICENSE file in the source repository for full details.

This Markdown formatted README provides a comprehensive guide on how to use the `Lunavex.EFCore.Pagination` package, suitable for your project's repository or documentation.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
8.0.1 141 3/28/2024
8.0.0 127 3/28/2024