Table of Contents

Class HttpContextPageUrlExtensions

Namespace
Trellis.Asp.ApiVersioning
Assembly
Trellis.Asp.ApiVersioning.dll

Adds explicitly API-version-pinned pagination builders to the ordinary HttpContextPaginationExtensions builders.

public static class HttpContextPageUrlExtensions
Inheritance
HttpContextPageUrlExtensions
Inherited Members

Methods

PageUrl(HttpContext, string, ApiVersion, Func<Cursor, int, RouteValueDictionary>)

Creates a request-scoped pagination URL builder pinned to a destination-supported version.

public static Func<Cursor, int, string> PageUrl(this HttpContext httpContext, string routeName, ApiVersion version, Func<Cursor, int, RouteValueDictionary> routeValues)

Parameters

httpContext HttpContext

The current request.

routeName string

The named destination route.

version ApiVersion

The version to pin on versioned destinations.

routeValues Func<Cursor, int, RouteValueDictionary>

Maps the cursor and applied limit to route values, which are cloned.

Returns

Func<Cursor, int, string>

A builder to invoke during this request.

Remarks

The pin overrides consumer query versions on versioned targets. Neutral and unversioned targets retain consumer values without injection. Explicit URL-segment pins throw. No host pagination policy registration is required for an explicit pin.

PageUrl(HttpContext, string, ApiVersion, Func<Cursor, PageDirection, int, RouteValueDictionary>)

Creates a request-scoped, direction-aware pagination builder pinned to an API version.

public static Func<Cursor, PageDirection, int, string> PageUrl(this HttpContext httpContext, string routeName, ApiVersion version, Func<Cursor, PageDirection, int, RouteValueDictionary> routeValues)

Parameters

httpContext HttpContext

The current request.

routeName string

The named destination route.

version ApiVersion

The version to pin on versioned destinations.

routeValues Func<Cursor, PageDirection, int, RouteValueDictionary>

Maps the cursor, direction, and applied limit to route values, which are cloned.

Returns

Func<Cursor, PageDirection, int, string>

A builder to invoke during this request.

Remarks

Destination selection, consumer-value precedence, neutral/unversioned skip rules, and rejection of explicit segment pins match the two-argument callback overload.