Evospike.PaginatedList 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Evospike.PaginatedList --version 1.0.0                
NuGet\Install-Package Evospike.PaginatedList -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="Evospike.PaginatedList" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Evospike.PaginatedList --version 1.0.0                
#r "nuget: Evospike.PaginatedList, 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.
// Install Evospike.PaginatedList as a Cake Addin
#addin nuget:?package=Evospike.PaginatedList&version=1.0.0

// Install Evospike.PaginatedList as a Cake Tool
#tool nuget:?package=Evospike.PaginatedList&version=1.0.0                

PaginatedList

Add pagination that only returns a list that only contains the requested page

Example of a controller using the extension method

[Route("[controller]")]
[ApiController]
public class ItemsController : ControllerBase
{
    private readonly ILogger<ItemsController> _logger;

    public ItemsController(ILogger<ItemsController> logger)
    {
        _logger = logger;
    }

    [HttpGet] //RETURN A TYPE DataCollection<T> | add using Evospike.PaginatedList.Models
    public async Task<DataCollection<Item>> GetAllAsync(int page = 1, int take = 50)
    {

        var collection = await _context.Items
                            .OrderByDescending(i => i.ItemId)
                            .GetPagedAsync(page, take); //EXTENSION METHOD HERE

        return collection;
    }

    [HttpGet] //RETURN A TYPE DataCollection<T> | add using Evospike.PaginatedList.Models
    public DataCollection<Item> GetAllAsync(int page = 1, int take = 50)
    {
        var lista = new List<string> { "test1", "test2", "test3" };
        var collection = lista.GetPaged(page, take); //EXTENSION METHOD HERE

        return collection;
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  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. 
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.1 622 8/18/2021
1.0.0 320 7/22/2021