Table of Contents

Namespace Trellis

Classes

AggregateETagExtensions

Extension methods for ETag-based optimistic concurrency validation on aggregate results. Two modes are available — the service owner chooses which to use:

Aggregate<TId>

Base class for aggregate roots in Domain-Driven Design. An aggregate is a cluster of domain objects (entities and value objects) that form a consistency boundary. The aggregate root is the only entry point for modifications and ensures all invariants within the boundary are maintained.

AsUnitExtensions

Asynchronous bridges that discard a result's success value and project to a no-payload Result<Unit>. Pairs with AsUnit() for sync receivers.

AuthChallenge

Represents a single HTTP authentication challenge (RFC 9110 §11.6.1). Multiple challenges may be combined to round-trip the full WWW-Authenticate header.

BindExtensions

Provides extension methods for binding (chaining) operations over Result values.

BindExtensionsAsync

Provides asynchronous extension methods for binding (chaining) operations over Result values.

BindZipExtensions

Extension methods that bind a function to a Result and zip the original value with the new value into a tuple. Enables sequential accumulation of values through a pipeline.

BindZipExtensionsAsync

Async BindZip extensions where both input and function are async (Task).

CheckExtensions

Provides extension methods for running validation functions on Result values while preserving the original value on success. If the check fails, its failure is returned.

CheckExtensionsAsync

Async Check extensions where BOTH input and check function are async (Task).

CheckIfExtensions

Provides conditional check extension methods for Result values. The check function is only invoked when the condition or predicate is true; otherwise the original result passes through unchanged.

CheckIfExtensionsAsync

Async CheckIf extensions where BOTH input and check function are async (Task).

CombineErrorExtensions

Combines two Error values into one. Two Error.InvalidInput values merge their field/rule violations. Otherwise the two errors are flattened into an Error.Aggregate.

CombineExtensions

Combines two or more Result<TValue> into one tuple containing all the Results.

CombineExtensionsAsync

Combines two or more Result<TValue> into one tuple containing all the Results.

Cursor

Opaque pagination cursor exchanged between server and client. Servers MUST treat the Token contents as their own private encoding; clients MUST treat it as a black box and only echo it back on the next request.

CursorCodec

AOT-friendly, versioned continuation codecs. Tokens are opaque, not signed. Existing unversioned tokens are deliberately rejected. Authorization must still filter every query.

DiscardExtensions

Provides extension methods for explicitly discarding a Result value. Use when the outcome is intentionally ignored (e.g., best-effort operations). This is the idiomatic alternative to _ = result; and suppresses TRLS001 without requiring pragma directives.

DiscardTaskExtensions

Provides async extension methods for explicitly discarding a Task-wrapped Result value.

DiscardValueTaskExtensions

Provides async extension methods for explicitly discarding a ValueTask-wrapped Result value.

EnsureAllExtensions

Provides extension methods for ensuring multiple conditions on Result values simultaneously. Unlike Ensure<TValue>(Result<TValue>, Func<TValue, bool>, Error) which short-circuits on the first failure, EnsureAll runs ALL checks and accumulates errors into a single combined error.

EnsureAllExtensionsAsync

Provides asynchronous extension methods for EnsureAll validation accumulation on Result values.

EnsureExtensions

Provides extension methods for ensuring conditions on Result values. If conditions fail, the result is converted to a failure with the specified error.

EnsureExtensionsAsync

Async Ensure extensions where BOTH input and predicates are async (Task).

EntityTagValue

Represents an RFC 9110 §8.8.1 entity tag (ETag) value with explicit weak/strong semantics.

Entity<TId>

Base class for entities in Domain-Driven Design. An entity is a domain object defined by its identity rather than its attributes. Two entities with different attributes but the same ID are considered equal.

EnumValueAttribute

Specifies the canonical symbolic value for a RequiredEnum<TSelf> member.

EquatableArray

Non-generic factory helpers for EquatableArray<T> that allow type inference.

Error

Closed discriminated union of Trellis error values. Domain-facing cases stay transport-neutral, while boundary-layer protocols can attach typed lower-level payloads through Error.TransportFault.

Error.Aggregate

Composition of multiple independent errors. Used when several failures occur together (e.g. parallel operations, batch validation). Nested Error.Aggregate values are flattened at construction. The constructor accepts at least one error. Boundary layers decide how to render the collection on their own wire.

Error.AuthenticationRequired

The operation requires authentication that was not supplied or could not be validated.

Error.Conflict

The request conflicts with the current state of the resource.

Error.Forbidden

Authorization policy refused the request.

Error.Gone

The resource was previously known but has been permanently removed (tombstone).

Error.InvalidInput

Inbound request payload failed semantic validation: one or more fields or rules rejected the input.

Error.InvariantViolation

Global or multi-field business invariant was violated (e.g. cross-field rule, computed constraint) outside the inbound-validation pipeline.

Error.NotFound

The requested resource does not exist.

Error.RateLimited

The caller has exceeded a usage quota; retry per Retry.

Error.TransportFault

Opaque envelope for transport-specific lower-layer failure payloads produced outside Trellis.Core. Domain code does not inspect the payload; the boundary layer that understands the transport is responsible for translation. The wrapped payload must implement ITransportFault.

Error.Unavailable

The system is temporarily unable to complete the operation; the caller should retry per Retry.

Error.Unexpected

An unhandled internal failure occurred. Code identifies the kind of failure; FaultId optionally correlates to deeper diagnostics.

ErrorRetryExtensions

Transport-neutral retry-classification helpers over the closed Error catalog. Lets workers, message consumers, and outbound-gateway callers ask "should I retry this, give up on this item, or halt the batch?" without hand-rolling parallel switch blocks against framework error types.

FaultCodes

The reason codes Trellis emits for outcomes that are not a validation failure of the caller's input — internal faults, and the conflicts and gaps a request can run into.

FieldViolation

Describes a validation failure attached to a specific field of an input document. Used inside Error.InvalidInput.

GetValueOrDefaultExtensions

Terminal extraction methods for Result values.

GetValueOrThrowExtensions

Production-safe throwing terminal extraction for Result<TValue>, intended for the narrow case where a failure represents a broken invariant the caller cannot act on — typically the persistence DTO → entity rehydration seam, where write-path validation guarantees the row is valid and any TryCreate failure on read indicates database corruption or migration drift.

HttpError

Closed discriminated union of HTTP-transport failures. Each case mirrors a status from the IANA HTTP Status Code Registry (RFC 9110, RFC 6585) and carries header data needed to emit an RFC-compliant response. Flows through Result<TValue> via the envelope Error.TransportFault: new Error.TransportFault(new HttpError.NotAcceptable(...)).

HttpError.ContentTooLarge

HTTP 413 — the request payload exceeds size limits.

HttpError.MethodNotAllowed

HTTP 405 — the HTTP method is not supported by the target resource.

HttpError.NotAcceptable

HTTP 406 — none of the available representations are acceptable to the client.

HttpError.PreconditionFailed

HTTP 412 — a request precondition (for example If-Match) failed.

HttpError.PreconditionRequired

HTTP 428 — the resource requires a precondition that the request did not include.

HttpError.RangeNotSatisfiable

HTTP 416 — the requested byte range cannot be satisfied.

HttpError.UnsupportedMediaType

HTTP 415 — the request's media type is not supported.

IntegrationEventNameAttribute

Declares the stable, on-the-wire name of an IIntegrationEvent so producers and consumers in different services can agree on the type a message carries.

MapExtensions

Provides extension methods for mapping (transforming) values inside Result objects.

MapExtensionsAsync

Provides asynchronous extension methods for mapping (transforming) values inside Result objects.

MapIfExtensions

Conditionally transforms the value inside a Result when a condition or predicate is met.

MapOnFailureExtensions

Provides extension methods for transforming errors in failed Results while leaving successful Results unchanged.

MatchExtensions

Pattern matching helpers (Match / Switch) for Result.

MatchExtensionsAsync

Asynchronous pattern matching helpers for Result.

MatchTupleExtensions

Provides pattern matching extension methods for Result types containing tuples (2-5 elements) with automatic destructuring. Match enables handling both success and failure cases inline with clean, readable code.

MatchTupleExtensionsAsync

Provides asynchronous pattern matching extension methods for Result types containing tuples (2-5 elements). Supports both Task and ValueTask for async pattern matching.

Maybe

Contains static methods to create a Maybe<T> object.

MaybeChooseExtensions

Extension methods for filtering and unwrapping Maybe<T> collections.

MaybeCollectionExtensions

Extension methods for safely querying collections, returning Maybe<T> instead of throwing.

MaybeExtensions

Provides extension methods for converting Maybe<T> instances to Result<TValue> objects.

MaybeExtensionsAsync

Asynchronous MatchAsync extension methods for Task<TResult> and ValueTask<TResult> of Maybe<T>.

MaybeInvariant

Provides static methods for validating invariants across multiple Maybe<T> values. These methods express relationships between correlated optional values — such as "all or none", "if A then B", or "exactly one" — and return Result<TValue> with field-level Error.InvalidInput details when the invariant is violated.

MaybeLinqExtensions

Provides LINQ query expression support for Maybe types, enabling C# query syntax for optional value composition.

MaybeLinqExtensionsTaskAsync

Provides LINQ query expression support for Task<TResult> of Maybe<T>, enabling C# query syntax over fully asynchronous Maybe-returning operations.

MaybeLinqExtensionsTaskLeftAsync

Async LINQ SelectMany overload where the source is a Task<TResult> of Maybe<T> and the collection selector is synchronous.

MaybeLinqExtensionsTaskRightAsync

Async LINQ SelectMany overload where the source is a synchronous Maybe<T> and the collection selector returns a Task<TResult> of Maybe<T>.

MaybeLinqExtensionsValueTaskAsync

Provides LINQ query expression support for ValueTask<TResult> of Maybe<T>, enabling C# query syntax over fully asynchronous Maybe-returning operations that may complete synchronously.

MaybeLinqExtensionsValueTaskLeftAsync

Async LINQ SelectMany overload where the source is a ValueTask<TResult> of Maybe<T> and the collection selector is synchronous.

MaybeLinqExtensionsValueTaskRightAsync

Async LINQ SelectMany overload where the source is a synchronous Maybe<T> and the collection selector returns a ValueTask<TResult> of Maybe<T>.

MaybeTaskAdapterExtensions

Provides adapters that wrap already-computed Maybe<T> values in completed task-like carriers. Useful for disambiguating Task<TResult> versus ValueTask<TResult> overloads at call sites (including LINQ query expressions over async Maybe carriers).

NegativeAttribute

Marks a partial RequiredInt<TSelf>, RequiredLong<TSelf>, or RequiredDecimal<TSelf>-derived class so the source generator rejects any value that is not strictly less than zero. Equivalent to [Range(MinValue, -1)] for integer types and a strictly-negative [Range] for decimal types.

NonNegativeAttribute

Marks a partial RequiredInt<TSelf>, RequiredLong<TSelf>, or RequiredDecimal<TSelf>-derived class so the source generator rejects any value strictly less than zero. Zero is accepted. Equivalent to [Range(0, MaxValue)].

NonPositiveAttribute

Marks a partial RequiredInt<TSelf>, RequiredLong<TSelf>, or RequiredDecimal<TSelf>-derived class so the source generator rejects any value strictly greater than zero. Zero is accepted. Equivalent to [Range(MinValue, 0)].

NotDefaultAttribute

Opts a Required*-derived value object into per-type sentinel rejection. Without this attribute the bare base accepts every concrete value and rejects only null; with it the generator emits a sentinel-rejection check appropriate to the underlying primitive.

Page

Non-generic factory companion for Page<T>. Mirrors the Result / Result<T> split: factory methods live on the non-generic type to keep generic-type surface minimal (CA1000) and to allow type inference at the call site.

PageBuilder

Storage-neutral assembly of forward pages from an ordered, sought, over-fetched batch.

PageRequest

Validated transport-neutral pagination inputs, before decoding query-specific state.

PageSize

Validated requested/applied limits. Missing input uses the default; non-positive input fails; above-cap input is clamped unless rejection is explicitly selected.

Page<T>

A single page of items from a paginated collection together with the cursors needed to fetch adjacent pages. The canonical Trellis primitive for server-driven pagination.

ParsableJsonConverter<T>

Converts value objects that implement IParsable<TSelf> to and from JSON.

PositiveAttribute

Marks a partial RequiredInt<TSelf>, RequiredLong<TSelf>, or RequiredDecimal<TSelf>-derived class so the source generator rejects any value that is not strictly greater than zero. Equivalent to applying [Range(1, MaxValue)] for integer types and a positive-fractional [Range] for decimal types, but reads as domain intent at the declaration site.

PrimitiveValueObjectTrace

Provides OpenTelemetry activity tracing for Trellis primitive value object operations.

PrimitiveValueObjectTraceProviderBuilderExtensions

Provides extension methods for configuring OpenTelemetry tracing for Trellis primitive value objects.

RailwayTrackAttribute

Indicates which railway track an operation executes on. This metadata can be used by IDE extensions, analyzers, and documentation generators.

RangeAttribute

Specifies the minimum and maximum allowed values for numeric value objects (RequiredInt<TSelf>, RequiredDecimal<TSelf>, RequiredLong<TSelf>).

RecoverExtensions

Provides extension methods for recovering from failures with a fallback value. Unlike RecoverOnFailureExtensions which requires a function returning a Result, Recover takes a simple fallback value and always produces a success.

RecoverExtensionsAsync

Provides asynchronous extension methods for recovering from failures with a fallback value.

RecoverOnFailureExtensions

Provides extension methods for recovering from failed results by executing fallback operations.

RecoverOnFailureExtensionsAsync

Provides asynchronous extension methods for recovering from failed results.

RepresentationMetadata

Carries HTTP representation metadata (RFC 9110 §8) through Trellis response mappers. Used to emit ETag, Last-Modified, Vary, Content-Language, and Content-Location response headers consistently across MVC and Minimal API responses (200, 201, 204, 304).

RepresentationMetadata.Builder

Fluent builder for constructing RepresentationMetadata instances.

RequiredBool<TSelf>

Base class for creating strongly-typed boolean value objects that distinguish between false (an explicit value) and null/missing (no value provided).

RequiredDateTimeOffset<TSelf>

Base class for creating strongly-typed DateTimeOffset value objects that prevent primitive obsession for instants on the wall clock with an offset from UTC. Rejects only null by default; MinValue rejection is opt-in via the NotDefaultAttribute attribute. Recommended for any DateTimeOffset type used as an EF-mapped property to preserve the database invariant guarantee enforced by TrellisScalarConverter on rehydration.

RequiredDateTime<TSelf>

Base class for creating strongly-typed DateTime value objects that prevent primitive obsession for dates. Rejects only null by default; MinValue rejection is opt-in via the NotDefaultAttribute attribute. Recommended for any DateTime type used as an EF-mapped property to preserve the database invariant guarantee enforced by TrellisScalarConverter on rehydration.

RequiredDecimal<TSelf>

Base class for creating strongly-typed decimal value objects that must be explicitly provided. Provides a foundation for monetary amounts, percentages, and other domain concepts represented by decimals. Rejects only null by default; rejection of 0 is opt-in via the NotDefaultAttribute attribute.

RequiredEnumJsonConverter<TRequiredEnum>

JSON converter for RequiredEnum<TSelf> types. Serializes to the string value and deserializes from string value.

RequiredEnum<TSelf>

Base class for creating strongly-typed, behavior-rich enumeration value objects. Enum value objects are a DDD pattern that replaces C# enums with full-featured classes.

RequiredGuid<TSelf>

Base class for creating strongly-typed GUID value objects. Rejects only null by default; Empty rejection is opt-in via the NotDefaultAttribute attribute. Recommended for any GUID type used as an Aggregate<TId> / Entity<TId> ID or as an EF-mapped property to preserve the database invariant guarantee enforced by TrellisScalarConverter on rehydration.

RequiredInt<TSelf>

Base class for creating strongly-typed integer value objects that must be explicitly provided. Provides a foundation for entity identifiers, counts, and other domain concepts represented by integers. Rejects only null by default; rejection of 0 is opt-in via the NotDefaultAttribute attribute.

RequiredLong<TSelf>

Base class for creating strongly-typed long integer value objects. Provides a foundation for large identifiers, sequence numbers, and other domain concepts represented by long integers. Rejects only null by default; rejection of 0 is opt-in via the NotDefaultAttribute attribute.

RequiredString<TSelf>

Base class for creating strongly-typed string value objects. Rejects only null by default; per-type sentinel rejection ("cannot be empty") and trimming are opt-in via the NotDefaultAttribute and TrimAttribute attributes.

ResourceCollectionNameAttribute

Overrides the naive plural form used when the framework synthesises a canonical resource URI for ProblemDetails.Instance from a ResourceRef. The default form is ResourceRef.Type.ToLowerInvariant() + "s"; this attribute lets the consumer supply an irregular plural (Person → people) or a domain-specific collection segment (UserAccount → accounts).

Result

Static Combine methods for combining multiple independent Result values without chaining (3-9 tuples).

ResultDebugExtensions

Debug extension methods for inspecting Result values during development. These methods execute only in DEBUG builds and become no-ops in RELEASE builds (with zero overhead).

ResultDebugExtensionsAsync

Debug-only async extension methods for inspecting Result values during development. These methods are only available in DEBUG builds and are automatically excluded from RELEASE builds. Debug information is written to dedicated Activity spans for OpenTelemetry compatibility.

ResultDebugSettings

Controls runtime behavior of ResultDebugExtensions methods (Debug, DebugDetailed, DebugWithStack, DebugOnSuccess, DebugOnFailure).

ResultLinqExtensions

Provides LINQ query expression support for Result types, enabling C# query syntax for functional operations.

ResultLinqExtensionsTaskAsync

Provides LINQ query expression support for Task<TResult> of Result<TValue>, enabling C# query syntax over fully asynchronous Result-returning operations.

ResultLinqExtensionsTaskLeftAsync

Async LINQ SelectMany overload where the source is a Task<TResult> of Result<TValue> and the collection selector is synchronous.

ResultLinqExtensionsTaskRightAsync

Async LINQ SelectMany overload where the source is a synchronous Result<TValue> and the collection selector returns a Task<TResult> of Result<TValue>.

ResultLinqExtensionsValueTaskAsync

Provides LINQ query expression support for ValueTask<TResult> of Result<TValue>, enabling C# query syntax over fully asynchronous Result-returning operations that may complete synchronously.

ResultLinqExtensionsValueTaskLeftAsync

Async LINQ SelectMany overload where the source is a ValueTask<TResult> of Result<TValue> and the collection selector is synchronous.

ResultLinqExtensionsValueTaskRightAsync

Async LINQ SelectMany overload where the source is a synchronous Result<TValue> and the collection selector returns a ValueTask<TResult> of Result<TValue>.

ResultRequiresExplicitHttpMappingConverter

Default JsonConverterFactory attached to Result<TValue>, IResult, and IResult<TValue> that fails fast when a result is JSON-serialized without going through Trellis's HTTP-mapping path (Result<T>.ToHttpResponse() in Trellis.Asp) or an explicit consumer converter. Without this converter, direct serialization could only emit public status/error metadata such as {"IsSuccess": bool, "IsFailure": bool, "Error": …} — a struct dump with no success value, not a stable wire shape, and not the HTTP problem-details / status-code mapping consumers expect from Trellis.

ResultTaskAdapterExtensions

Provides adapters that wrap already-computed Result<TValue> values in completed task-like carriers.

ResultsTraceProviderBuilderExtensions

Extension methods for configuring OpenTelemetry tracing for Railway Oriented Programming operations.

RetryAfterValue

Represents an RFC 9110 §10.2.3 Retry-After value, which can be either a delay in seconds or an absolute HTTP-date indicating when the client may retry.

RuleViolation

Describes a global or multi-field business-rule failure attached to a Error.InvalidInput. Use this for invariant violations that are not bound to a single field (e.g. "order.must-have-items", "password.mismatch", "order.cancel-after-ship").

ScalarValueObject<TSelf, T>

Base class for value objects that wrap a single scalar value. Provides a strongly-typed wrapper around primitive types with domain semantics.

SequenceAllExtensions

Accumulating-error counterpart to Sequence<T>(IEnumerable<Result<T>>). Runs through every item; folds failures via the existing Combine(Error?, Error) extension so two Error.InvalidInput failures merge their fields/rules and heterogeneous failures flatten into Error.Aggregate.

Specification<T>

Base class for the Specification pattern. Encapsulates a business rule as a composable, storage-agnostic expression tree.

StringExtensions

String manipulation helpers for value object field name normalization.

StringLengthAttribute

Specifies the minimum and maximum length of characters that are allowed in a RequiredString<TSelf>-derived value object.

TapExtensions

Provides extension methods for executing side effects on successful Results without changing the Result.

TapExtensionsAsync

Provides asynchronous extension methods for executing side effects on successful Results without changing the Result.

TapOnFailureExtensions

Provides extension methods for executing side effects on failed Results without changing the Result.

TapOnFailureExtensionsAsync

Provides asynchronous extension methods for executing side effects on failed Results without changing the Result.

ToMaybeExtensions

Provides extension methods for converting Result{T} to Maybe{T}. Success results become Some(value), failure results become None.

ToMaybeExtensionsAsync

Provides asynchronous extension methods for converting Result{T} to Maybe{T}.

TraverseAllExtensions

Accumulating-error counterpart to Traverse<TIn, TOut>(IEnumerable<TIn>, Func<TIn, Result<TOut>>). Runs the selector over every item (no short-circuit) and folds failures via the existing Combine(Error?, Error) extension. Useful for form-style validation where every error matters, not just the first one encountered.

TraverseExtensions

Transforms a collection of items into a Result containing a collection, short-circuiting on the first failure. Useful for processing collections where each item can fail independently.

TrellisJsonValidationException

Thrown by Trellis JSON converters when a structured value object's invariants are violated during deserialization (e.g., Money's amount/currency rules).

TrellisValidationFormatException

A FormatException that also carries the structured validation failure that caused it.

TrimAttribute

Opts a RequiredString<TSelf>-derived value object into trim-before-validate. Without this attribute the input string is stored verbatim; with it the generator trims the input before any other check, so combined with NotDefaultAttribute a whitespace-only input trims to Empty and is rejected.

ValidationArgValue

The value of a single entry in the Args carried by a FieldViolation or RuleViolation.

ValidationArgValue.Bool

A boolean operand, written to JSON as true or false.

ValidationArgValue.List

An ordered list of operands, written to JSON as an array.

ValidationArgValue.Number

A numeric operand, written to JSON as a number.

ValidationArgValue.Text

A textual operand, written to JSON as a string.

ValidationArgValueJsonConverter

Writes a ValidationArgValue as its underlying JSON primitive, and reads one back.

ValidationArgs

Builds the Args dictionary carried by a FieldViolation or RuleViolation.

ValidationCodes

The closed set of machine-readable reason codes Trellis itself emits.

ValidationMeterProviderBuilderExtensions

Extension methods for collecting Trellis validation metrics with OpenTelemetry.

ValidationMetrics

The Trellis.ValidationMetrics.Meter and instruments Trellis publishes for validation failures.

ValueObject

Base class for value objects in Domain-Driven Design. A value object represents a descriptive aspect of the domain with no conceptual identity. Value objects are immutable, defined by their attributes, and support structural equality.

WhenAllExtensionsAsync

Provides Await extension methods for waiting on multiple Task-wrapped Result instances and combining them. These methods enable efficient parallel execution of independent async operations with Result aggregation.

WhenExtensions

Conditionally executes an operation based on a predicate, maintaining the railway. Useful for executing operations only when certain conditions are met without breaking the Result chain.

WhenExtensionsAsync

Asynchronous conditional execution operations for Result.

WriteOutcome

Factory helpers that build a WriteOutcome<T> case but return the base type, so call sites flow through generic pipelines (for example Result.Map / ToHttpResponse) without an explicit (WriteOutcome<T>) cast to widen the nested case. Mirrors the non-generic Result / generic Result<T> pairing.

WriteOutcome<T>

Represents the outcome of a write operation (create / replace / accept-for-async) returned by Application-layer repositories. The case selected describes what happened; HTTP-aware boundary adapters (for example Trellis.Asp) translate each case to status codes and headers.

WriteOutcome<T>.Accepted

The write was accepted for asynchronous processing and a status body is returned. Transports as HTTP 202 Accepted.

WriteOutcome<T>.AcceptedNoContent

The write was accepted for asynchronous processing with no status body. Transports as HTTP 202 Accepted.

WriteOutcome<T>.Created

A new resource was created. Transports as HTTP 201 Created.

WriteOutcome<T>.Updated

An existing resource was replaced/updated and the new representation is returned. Transports as HTTP 200 OK.

WriteOutcome<T>.UpdatedNoContent

An existing resource was replaced/updated and no body is returned. Transports as HTTP 204 No Content.

Structs

EqualityComponents

Collects the components that define a ValueObject's structural equality.

EquatableArray<T>

Wraps an ImmutableArray<T> to provide structural (sequence) equality.

InputPointer

A pointer into a structured input document, expressed as an RFC 6901 JSON Pointer. Used by validation errors to identify the location of an offending value.

Maybe<T>

Represents domain-level optionality — a value that was either provided or intentionally omitted. Unlike Nullable<T> (value types only) or T? (annotation only for reference types), Maybe<T> is a real generic type that works uniformly with both value and reference types and composes with Result<TValue> pipelines.

ResourceRef

Identifies a resource by its type and optional identifier. Used as the typed payload for resource-oriented errors such as Error.NotFound, Error.Conflict, Error.Gone, and transport faults that still identify a resource.

Result<TValue>

Represents either a successful computation (with a value) or a failure (with an Error).

RetryAdvice

Transport-neutral retry hint attached to Error.RateLimited and Error.Unavailable. Boundary layers translate to their own wire format (e.g. a header on a synchronous response, an envelope field on a queued message, or a structured field on a CLI exit envelope). Producers in the domain layer describe when the caller may retry; how that is conveyed is the boundary's concern.

Unit

Sentinel type representing the absence of a meaningful value. Used as the type parameter for no-payload results: Result<Unit> represents an operation that either succeeds without producing a value or fails with an Error.

Interfaces

IAggregate

Defines the contract for an aggregate root in Domain-Driven Design. An aggregate is a cluster of domain objects that can be treated as a single unit for data changes.

ICodedTransportFault

A transport fault that carries its own machine-readable code and kind, so a boundary can publish them without knowing which transport produced the failure.

ICursorCodec<TState>

A typed continuation codec. Parsing client input returns failures; encoding invalid server state throws.

IDomainEvent

Represents a domain event - a record of something significant that happened in the business domain. Domain events capture state changes and business occurrences that domain experts care about.

IETagStampable

Infrastructure seam that lets a persistence adapter stamp an aggregate's optimistic-concurrency token (ETag) without reflection.

IEntity

Non-generic interface for all entities in Domain-Driven Design. Provides automatic timestamp tracking — CreatedAt records when the entity was first persisted, and LastModified tracks the most recent change.

IFailureFactory<TSelf>

Enables construction of a failure result of the implementing type from an Error. Implemented by Result<TValue> to support generic pipeline behaviors that need to construct failure results without knowing the inner type parameter.

IFormattableScalarValue<TSelf, TPrimitive>

Extended interface for scalar value objects that support culture-sensitive string parsing. Use for numeric and date types where IFormatProvider matters for parsing.

IIntegrationEvent

Represents an integration event - the stable, published contract a bounded context emits to the outside world (other services or bounded contexts), as distinct from an IDomainEvent which stays inside the context and is raised by aggregates.

IPersistOnFailure

Opt-in interface implemented by result types whose failure outcome should still trigger any post-handler persistence step (e.g. TransactionalCommandBehavior's commit) so the failure state is durably recorded alongside the rest of the staged work.

IReconstitutionStampable

Infrastructure seam that lets a non-EF persistence adapter restore a reconstituted aggregate's persistence-managed metadata — audit timestamps and the optimistic-concurrency token — and clear its uncommitted domain events in one infra-only call.

IResult

Non-generic base interface for result types, exposing success/failure state and error information.

IResult<TValue>

Generic interface for result types, providing typed access to the success value.

IScalarValue<TSelf, TPrimitive>

Interface for scalar value objects that can be created with validation. Enables automatic ASP.NET Core model binding and JSON serialization.

ITrackedAggregateSource

Exposes the set of aggregates a unit of work tracked at the most recent successful commit.

ITransportFault

Marker interface for transport-layer failure payloads carried by Error.TransportFault. Implemented by transport-specific error unions (e.g., HTTP, gRPC, message bus) defined in non-Core packages. Domain code does not inspect implementations; it treats Error.TransportFault as opaque lower-layer failure.

Enums

InputLocation

Identifies which part of an input an offending value came from.

PageSizeLimitPolicy

Policy for a requested limit above the server maximum.

PreconditionKind

Identifies which conditional precondition was the subject of a HttpError.PreconditionFailed or HttpError.PreconditionRequired fault.

RetryClassification

Transport-neutral classification of Error values for outer retry loops (background workers, message-broker consumers, outbound-gateway callers). Answers the question "given this failure, what should the surrounding job do next?" without committing to any specific transport or retry policy.

TrackBehavior

Defines which railway track an operation runs on in Railway-Oriented Programming.