OnPage 7.0.0.1

dotnet add package OnPage --version 7.0.0.1
NuGet\Install-Package OnPage -Version 7.0.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="OnPage" Version="7.0.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OnPage --version 7.0.0.1
#r "nuget: OnPage, 7.0.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 OnPage as a Cake Addin
#addin nuget:?package=OnPage&version=7.0.0.1

// Install OnPage as a Cake Tool
#tool nuget:?package=OnPage&version=7.0.0.1

#In this version we add

public class PagedResult<T>
{
    public PagedResult(IQueryable<T> query, int pageIndex, int pageSize, long totalItemsCount)
    {
        if (query == null)
            throw new ArgumentNullException(nameof(query));
        Items = query.Page(pageIndex, pageSize).ToImmutableArray();
        PageIndex = pageIndex;
        PageSize = pageSize;
        TotalItemsCount = totalItemsCount;
        TotalPagesCount = pageSize != 0L ? (long)Math.Ceiling(totalItemsCount / (Decimal)pageSize) : 0L;
    }

    public long PageIndex { get; }

    public long PageSize { get; }

    public long TotalPagesCount { get; }

    public long TotalItemsCount { get; }

    public IReadOnlyCollection<T> Items { get; }

}

Extension

public static PagedResult<T> ToPageResult<T>(this IQueryable<T> query, int pageIndex, int pageSize)
        => new PagedResult<T>(query, pageIndex, pageSize, query.Count());
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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.
  • net7.0

    • No dependencies.

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
7.0.0.1 565 8/20/2023
7.0.0 737 7/24/2023
6.0.0 203 7/24/2023
1.0.0 153 7/24/2023