Namespace Trellis.Asp
Classes
- ActionResultExtensions
Provides extension methods to convert Result types to ASP.NET Core ActionResult responses. These methods bridge Railway Oriented Programming with ASP.NET Core MVC/Web API controllers.
- ActionResultExtensionsAsync
Provides asynchronous extension methods to convert Task/ValueTask-wrapped Result types to ASP.NET Core ActionResult responses. These methods enable clean async/await patterns in controllers while maintaining Railway Oriented Programming benefits.
- 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.
- ConditionalRequestEvaluator
Evaluates RFC 9110 §13 conditional request headers against representation metadata, applying the correct precedence rules from §13.2.2:
- If-Match → 2. If-Unmodified-Since → 3. If-None-Match → 4. If-Modified-Since
- ETagHelper
RFC 9110-compliant entity tag comparison helpers.
- HttpResultExtensions
Provides extension methods to convert Result types to ASP.NET Core Minimal API IResult responses. These methods bridge Railway Oriented Programming with ASP.NET Core Minimal APIs.
- HttpResultExtensionsAsync
Provides asynchronous extension methods to convert Task/ValueTask-wrapped Result types to ASP.NET Core Minimal API IResult responses. These methods enable clean async patterns in Minimal API endpoints while maintaining Railway Oriented Programming benefits.
- IfNoneMatchExtensions
Extension methods for If-None-Match validation on unsafe methods (create-if-absent patterns).
- PartialContentHttpResult
A Minimal API IResult that returns HTTP 206 Partial Content with a
Content-Rangeheader. Used to indicate that the response contains a subset of the requested resource.
- PartialContentResult
Represents an ObjectResult that returns HTTP 206 Partial Content with a Content-Range header. Used to indicate that the response contains a subset of the requested resource.
- PreferHeader
Parses the RFC 7240
Preferrequest header and exposes standard preference tokens.
- RangeOutcome
Result of evaluating a Range request per RFC 9110 §14.
- RangeOutcome.FullRepresentation
No Range header or range not applicable — serve full representation.
- RangeOutcome.NotSatisfiable
Range not satisfiable (416).
- RangeOutcome.PartialContent
Range satisfiable — serve partial content (206).
- RangeRequestEvaluator
Evaluates RFC 9110 §14 Range request headers. Only supports byte ranges. Non-GET requests are treated as Full (Range ignored).
- 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 400 Bad Request response with validation problem details when validation fails.
- 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 how domain error types are mapped to HTTP status codes.
- ValidationErrorsContext
Provides a context for collecting validation errors during JSON deserialization. Uses AsyncLocal to maintain thread-safe, request-scoped error collection.
- WriteOutcomeExtensions
Maps WriteOutcome<T> to ActionResult/IResult with correct status codes and headers.
- WriteOutcome<T>
Represents the outcome of a write operation (PUT/POST/DELETE) per RFC 9110 §9.3.4.
- WriteOutcome<T>.Accepted
Request accepted for async processing — maps to 202 Accepted with a status body.
- WriteOutcome<T>.AcceptedNoContent
Request accepted for async processing — maps to 202 Accepted with no body.
- WriteOutcome<T>.Created
Resource was created — maps to 201 Created.
- WriteOutcome<T>.Updated
Resource was replaced/updated — maps to 200 OK.
- WriteOutcome<T>.UpdatedNoContent
Resource was replaced/updated with no body — maps to 204 No Content.
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
- ConditionalDecision
Decision returned by the conditional request evaluator per RFC 9110 §13.2.2.