Pitman.Paged 1.0.0

dotnet add package Pitman.Paged --version 1.0.0
                    
NuGet\Install-Package Pitman.Paged -Version 1.0.0
                    
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="Pitman.Paged" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pitman.Paged" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Pitman.Paged" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Pitman.Paged --version 1.0.0
                    
#r "nuget: Pitman.Paged, 1.0.0"
                    
#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.
#:package Pitman.Paged@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Pitman.Paged&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Pitman.Paged&version=1.0.0
                    
Install as a Cake Tool

Pitman.Paged

This code provides a flexible and easy-to-use implementation of paged results for use in .NET applications. The IPagedResult<T> interface defines the properties necessary for implementing paged results, and the PagedResult<T> class provides a concrete implementation of this interface. Additionally, the PagedResultExtensions class offers extension methods for easily retrieving paged results from IQueryable and IIncludableQueryable sources, as well as converting the results of one PagedResult<T> to another PagedResult<TProperty>. This package is useful for applications that require efficient handling of large datasets and pagination of query results.

Usage

You can use "Pitman.Paged" in your .NET project by installing the "Pitman.Paged" NuGet package.

Installation

You can install "Pitman.Paged" by running the following command in the Package Manager Console:

Install-Package Pitman.Paged

Example

Here's an example of how to use "Pitman.Paged" to paginate an IQueryable collection of entities.

Using Asp.net

On a controller add "int page, int pageSize". In the URL add the parameters "page" with the current page number and "pageSize" with the size of each page.

Example of an url sorting the by temperatureC as property name:

https://localhost:7201/customers?page=2&pageSize=10
Full Example
[HttpGet]
public async Task<IActionResult> Get(int page, int pageSize) // receive paging information from url parameters
{
    var queryable = dbContext.Customers.AsQueryable();
    
    pagedResult = await queryable.GetPaged(page, pageSize); // apply the paging on the IQueryable

    return Ok(pagedResult);
}

Contributing

Contributions to "Pitman.Paged" are welcome and encouraged! If you find a bug or have a feature request, please create an issue in the repository. If you'd like to contribute code to the project, please open a pull request with your changes.

License

"Pitman.Paged" is released under the MIT License. See LICENSE for details.

Product 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.  net9.0 was computed.  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 was computed.  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. 
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
1.0.0 329 3/16/2023