RzR.ResultMessage.Pagination.AspNetCore 4.0.0.7837

dotnet add package RzR.ResultMessage.Pagination.AspNetCore --version 4.0.0.7837
                    
NuGet\Install-Package RzR.ResultMessage.Pagination.AspNetCore -Version 4.0.0.7837
                    
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="RzR.ResultMessage.Pagination.AspNetCore" Version="4.0.0.7837" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RzR.ResultMessage.Pagination.AspNetCore" Version="4.0.0.7837" />
                    
Directory.Packages.props
<PackageReference Include="RzR.ResultMessage.Pagination.AspNetCore" />
                    
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 RzR.ResultMessage.Pagination.AspNetCore --version 4.0.0.7837
                    
#r "nuget: RzR.ResultMessage.Pagination.AspNetCore, 4.0.0.7837"
                    
#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 RzR.ResultMessage.Pagination.AspNetCore@4.0.0.7837
                    
#: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=RzR.ResultMessage.Pagination.AspNetCore&version=4.0.0.7837
                    
Install as a Cake Addin
#tool nuget:?package=RzR.ResultMessage.Pagination.AspNetCore&version=4.0.0.7837
                    
Install as a Cake Tool

RzR.ResultMessage.Pagination.AspNetCore

ASP.NET Core integration for RzR.ResultMessage.Pagination.EntityFrameworkCore. Adds a base controller, query-string model binding, minimal-API binders (.NET 7+), standard pagination headers, an allow-list registry, RFC 9457 ProblemDetails on the failure path, and an OpenAPI convention that auto-annotates paged endpoints.

Targets: netstandard2.1, net5.0, net6.0, net7.0, net8.0, net9.0. Minimal-API helpers are gated to .NET 7+.

Install

Install-Package RzR.ResultMessage.Pagination.AspNetCore

What you get

  • BaseApiPagedResultController with PagedOkResult<T> / PagedXmlResult<T>.
  • [FromPagedQuery] MVC model binder for PagedRequest / PageRequestWithFilters.
  • PagedQuery<T> / PagedQueryWithFilters<T> minimal-API wrappers (.NET 7+).
  • WithPagedResult() endpoint filter and ToPagedHttpResult adapter.
  • Headers: X-Total-Count, X-Page-Count, X-Page-Size, X-Current-Page, RFC 5988 Link (GET only), Server-Timing: paged;dur=<ms> (opt-in).
  • Per-entity allow-list via ConfigurePageable<T>(b => b.AllowSort(...).AllowFilter(...).AllowSearch(...)).
  • OpenAPI convention via AddPagedListResultApiExplorer().

Setup

builder.Services
    .AddControllers()
    .AddPagedListResultApiExplorer();

builder.Services
    .AddPagedListResultWeb(o =>
    {
        o.MaxPageSize = 100;
        o.DefaultPageSize = 25;
    })
    .ConfigurePageable<Product>(p =>
    {
        p.AllowSort("Id", "Name", "Price", "CreatedOn");
        p.AllowFilter("Status", "Price", "CreatedOn");
        p.AllowSearch("Name", "Description");
    });

MVC controller

public sealed class ProductsController : BaseApiPagedResultController
{
    private readonly AppDbContext _db;
    public ProductsController(AppDbContext db) => _db = db;

    [HttpGet]
    public async Task<IActionResult> List(
        [FromPagedQuery(typeof(Product))] PageRequestWithFilters request,
        CancellationToken ct)
    {
        if (!ModelState.IsValid) return ValidationProblem(ModelState);

        var paged = await _db.Products.AsNoTracking()
            .GetPagedWithFiltersAsync(request, cancellationToken: ct);

        return PagedOkResult(paged);
    }
}

Minimal API (.NET 7+)

app.MapGet("/products",
    async (PagedQueryWithFilters<Product> q, AppDbContext db, HttpContext ctx, CancellationToken ct) =>
    {
        if (!q.IsValid)
            return Results.ValidationProblem(
                q.Errors.ToDictionary(e => e.Key, e => new[] { e.Value }));

        var paged = await db.Products.AsNoTracking()
            .GetPagedWithFiltersAsync(q, cancellationToken: ct);

        return paged.ToPagedHttpResult(ctx);
    })
    .WithPagedResult();

Query-string syntax

GET /products
    ?page=2
    &pageSize=20
    &order=price:desc
    &search=usb
    &filter=status:Equals:active
    &filter=price:Between:10,100
    &fields=Id,Name,Price
Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  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 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 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.  net9.0 is compatible.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on RzR.ResultMessage.Pagination.AspNetCore:

Package Downloads
PagedListResult

DEPRECATED. This package has been renamed to RzR.ResultMessage.Pagination.EntityFrameworkCore starting with version 4.0.0.7837 This 3.2.0 release contains no code; it only depends on the new package so existing restores keep working. Please update your PackageReference and your `using` directives: PagedListResult -> RzR.ResultMessage.Pagination.EntityFrameworkCore using PagedListResult.* -> using RzR.ResultMessage.Pagination.EntityFrameworkCore.*

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.0.7837 35 4/30/2026