Namespace Trellis.Asp
Classes
- ActionResultAdapterExtensions
MVC adapter that wraps an IResult in an ActionResult<TValue> so MVC controllers can declare typed return signatures (e.g.
Task<ActionResult<TodoResponse>>) for OpenAPI inference and[ProducesResponseType<T>]compatibility.
- AggregateRepresentationValidator<T>
Default representation validator for aggregates. Uses the aggregate's built-in ETag. When a variant key is provided, combines it with the ETag using a hash.
- ApplicationBuilderExtensions
IApplicationBuilder extensions for Trellis ASP.NET integration.
- CacheControl
Common CacheControlHeaderValue presets for use with WithCacheControl(CacheControlHeaderValue) and WithCacheControl(CacheControlHeaderValue).
- ETagHelper
RFC 9110-compliant entity tag comparison helpers.
- FieldViolationProblemDetail
JSON shape used for field violations in ProblemDetails extensions.
- HttpContextPaginationExtensions
Builds named-route pagination URLs without requiring an API-versioning package.
- HttpRequestPaginationExtensions
Parses transport-neutral pagination values from ASP.NET Core requests.
- HttpResponseExtensions
The single Trellis verb for converting Result<TValue> / WriteOutcome<T> / Page<T> values to ASP.NET Core HTTP responses. Works in both Minimal API endpoints and MVC controllers (.NET 7+ executes IResult natively in MVC). For typed
ActionResult<T>signatures, chain AsActionResult<T>(IResult).
- HttpResponseOptionsBuilder
Non-generic builder used for Result (no value).
- HttpResponseOptionsBuilder<TDomain>
Fluent options builder for ToHttpResponse<T>(Result<T>, Action<HttpResponseOptionsBuilder<T>>?). Selectors run against the
TDomainvalue (not the projected response body).
- IfNoneMatchExtensions
Extension methods for If-None-Match validation on unsafe methods (create-if-absent patterns).
- InputOriginAttribute
Overrides where validation failures that reach this endpoint without a location of their own are said to have come from.
- LocationRouteContext
Describes the final named-route or MVC-action destination of a generated Location header. Supplied to
HttpResponseOptionsBuilder<TDomain>.WithLocationRouteResolverat execution time.
- PageLink
A cursor + the absolute URL the client should follow to fetch the linked page.
- PageUrlRouteContext
Describes the named destination of a pagination URL.
- PagedResponse<TResponse>
JSON envelope wrapping a single page of items and its cursor links.
- PreferHeader
Parses the RFC 7240
Preferrequest header and exposes standard preference tokens.
- RateLimiterOptionsExtensions
Configures ASP.NET Core rate-limit rejections to use the canonical Trellis Problem Details response.
- ResourceCollectionNameOverride
A single resource-type-to-collection-name override registered via
AddResourceCollectionNameor discovered byAddResourceCollectionNames(Assembly). Registered as a DI singleton; the ResourceCollectionNameRegistry consumes the full enumeration at activation time.
- ResourceCollectionNameRegistry
Resolves the
collectionsegment used when the framework synthesises a canonical resource URI forProblemDetails.Instancefrom a ResourceRef. Override entries take precedence; otherwise the registry falls back to a naive plural (type.ToLowerInvariant() + "s").
- ResourceCollectionNameServiceCollectionExtensions
Extension methods for registering ResourceCollectionNameOverride entries and the consuming ResourceCollectionNameRegistry.
- RuleViolationProblemDetail
JSON shape used for rule violations in ProblemDetails extensions.
- ScalarValueValidationEndpointFilter
An endpoint filter that checks for scalar value validation errors collected during JSON deserialization. For Minimal APIs, this filter returns validation problem results when validation errors are detected.
- ScalarValueValidationFilter
An action filter that checks for validation errors collected during JSON deserialization and validates IScalarValue<TSelf, TPrimitive> route/query parameters. Returns a
ValidationProblemDetailsresponse — 422 Unprocessable Content for Trellis-driven semantic validation failures (composite VO converter, scalar VO TryCreate, ValidationErrorsContext-collected errors) per RFC 9110 §15.5.21, and 400 Bad Request for plain JsonExceptions where the bytes aren't valid JSON per RFC 9110 §15.5.1. When both occur on the same request, 400 wins.
- ScalarValueValidationMiddleware
Middleware that creates a validation error collection scope for each request. This enables ValidatingJsonConverter to collect validation errors across the entire request deserialization process.
- ServiceCollectionExtensions
Extension methods for configuring automatic value object validation in ASP.NET Core.
- TrellisAspOptions
Configuration options for Trellis ASP.NET Core integration. Controls error-to-status-code mapping and host-local pagination route policies.
- ValidationErrorsContext
Provides a context for collecting validation errors during JSON deserialization. Uses AsyncLocal to maintain thread-safe, request-scoped error collection.
- ViolationLocation
The wire form of a validation error's location: which part of the input it came from, and where within that part.
Interfaces
- IRepresentationValidator<T>
Strategy for generating representation-specific validators (ETags) that account for content negotiation variants per RFC 9110 §8.8.3.1/§8.8.3.3.
Enums
- PageDirection
The direction of a cursor link relative to the current page.