Table of Contents

Namespace Trellis.EntityFrameworkCore

Classes

CheckpointModelBuilderExtensions

EF Core model hook for the pull-consumer checkpoint table.

CheckpointServiceCollectionExtensions

Registers the pull-consumer checkpoint store for a DbContext.

ConsumerCheckpoint

A persisted resume cursor: the last Position a pull consumer (ConsumerId) has advanced past in its source feed.

ConsumerCheckpointConfiguration

EF Core mapping for ConsumerCheckpoint. Applied to a consumer's model via AddTrellisConsumerCheckpoints(ModelBuilder).

DbContextExtensions

Extension methods on DbContext that wrap SaveChangesAsync(CancellationToken) and convert expected database exceptions to Result<TValue> failures.

DbContextIdempotencyExtensions

Idempotency helpers for DbContext that convert provider-level unique-constraint violations into Result<TValue> failures with a structured Error.Conflict payload, so callers can express "insert this row unless it already exists" without having to write provider-specific exception handling at each call site.

DbContextOptionsBuilderExtensions

Extension methods for DbContextOptionsBuilder that register Trellis EF Core interceptors.

DbContextRetryExtensions

Retry-on-collision save extensions for DbContext. Adds SaveChangesWithRetryAsync(DbContext, Func<DbUpdateException, bool>, Func<IReadOnlyList<EntityEntry>, int, CancellationToken, ValueTask<bool>>, int, CancellationToken) for the system-generated unique-key INSERT-and-regenerate pattern.

DbExceptionClassifier

Classifies database exceptions across providers (SQL Server, PostgreSQL, SQLite, MySQL/MariaDB). Used internally by both SaveChangesResultAsync(DbContext, CancellationToken) and SaveChangesResultAsync(DbContext, bool, CancellationToken) overloads. Also available for direct use in repositories that need custom error messages per exception type.

EfUnitOfWork<TContext>

EF Core implementation of Trellis.IUnitOfWork and ITrackedAggregateSource. Delegates to SaveChangesResultUnitAsync(DbContext, CancellationToken) which already maps DbUpdateConcurrencyException to Error.Conflict, duplicate-key exceptions to Error.Conflict, and foreign-key violations to Error.Conflict.

EntityTimestampInterceptor

EF Core SaveChanges interceptor that automatically sets CreatedAt and LastModified on entities before save.

GeoCoordinateExpressions

Builds provider-translatable expressions for geographic bounding and spherical distance queries.

InboxMessage

A persisted record that a (ConsumerId, MessageId) message has been processed. Its existence is the dedup guarantee: a redelivery of the same message finds the row and is skipped, so a handler's side effects run effectively once.

InboxMessageConfiguration

EF Core mapping for InboxMessage. Applied to a consumer's model via AddTrellisInbox(ModelBuilder).

InboxModelBuilderExtensions

EF Core model hook for the transactional inbox.

InboxOptions

Tuning for the transactional inbox (idempotent integration-event consumption).

InboxServiceCollectionExtensions

Registers the transactional inbox for a DbContext.

MaybeColumnMapping

A resolved relational column belonging to a scalar or owned Maybe<T> value.

MaybeEntityTypeBuilderExtensions

Entity type builder helpers that resolve Maybe<T> properties to their mapped storage members.

MaybeModelExtensions

Diagnostics helpers for inspecting resolved EF Core mappings for Maybe<T> properties.

MaybePropertyMapping

Describes how a Maybe<T> property resolved to an EF Core mapped backing field.

MaybeQueryInterceptor

An EF Core query expression interceptor that automatically rewrites Maybe<T> property accesses in LINQ expression trees to their underlying storage member equivalents.

MaybeQueryableExtensions

LINQ query extensions for Maybe<T> properties backed by generated nullable storage members. These methods rewrite the expression tree to target the underlying _camelCase storage member via Property<TProperty>(object, string), enabling EF Core to translate the query to SQL.

MaybeUpdateExtensions

ExecuteUpdate helpers for setting and clearing mapped Maybe<T> properties via CLR selectors.

ModelConfigurationBuilderExtensions

Extension methods for ModelConfigurationBuilder that register Trellis value object conventions before EF Core model building.

OutboxMessage

A persisted event awaiting relay — a transactional-outbox row. Carries either a captured IDomainEvent or a translated IIntegrationEvent, distinguished by Kind.

OutboxMessageConfiguration

EF Core mapping for OutboxMessage. Applied to a consumer's model via AddTrellisOutbox(ModelBuilder).

OutboxModelBuilderExtensions

EF Core model and interceptor hooks for the transactional outbox.

OutboxOptions

Tuning for the transactional outbox relay (OutboxRelay{TContext}).

OutboxServiceCollectionExtensions

Registers the transactional outbox relay for a DbContext.

OwnedEntityAttribute

Marks a composite ValueObject as an EF Core owned entity type, triggering source generation of the private parameterless constructor required for EF Core materialization.

PaginationQueryableExtensions

Forward-only seek pagination. Ordering must end in a stable unique key. Provider translation failures and cancellation propagate; invalid client cursors return InvalidInput. Value-object projections require the Trellis query interceptors.

QueryableExtensions

Extension methods on IQueryable<T> that wrap EF Core query results in Maybe<T> or Result<TValue>.

RepositoryBase<TAggregate, TId>

Base class for EF Core repositories that persist Aggregate<TId> instances. Provides standard read and staging methods. Repositories stage changes to the DbContext change tracker; the Trellis.IUnitOfWork (typically driven by a pipeline behavior) is responsible for committing staged changes.

ScalarValueQueryInterceptor

An EF Core query expression interceptor that enables natural scalar value object syntax in LINQ queries — comparisons, string methods, and properties translate to SQL without requiring .Value.

SeekDefinition

Factories for storage-translatable seek definitions. Does not perform client-side query fallback.

SeekDefinition<T, TState>

Defines ordering, boundary extraction and lexicographic seeking together. Keys must be non-null and stable, and the final ordering must be unique. Provider translation and comparison semantics must be verified for the selected keys.

TrellisPersistenceMappingException

Represents a failure to materialize a Trellis value object from persisted data.

TrellisScalarConverter<TModel, TProvider>

Value converter for Trellis IScalarValue<TSelf, TPrimitive> types.

Converts to database using the Value property and from database using the type's validation factory methods. Invalid persisted values throw TrellisPersistenceMappingException with explicit materialization details.

UnitOfWorkServiceCollectionExtensions

Extension methods for registering Trellis.IUnitOfWork and the TransactionalCommandBehavior<TMessage, TResponse> pipeline behavior.

Interfaces

IOutboxMaintenance

Operator-facing maintenance for the transactional outbox: inspect dead-lettered (parked) messages and replay them once the cause of their failure has been fixed (for example after deploying the missing handler assembly or correcting a bad payload). Resolve it from a scope — an admin endpoint, a CLI, or a maintenance job — alongside the relay.

Enums

MaybeStorageKind

The resolved storage shape of a Maybe<T> property.

OutboxMessageKind

Discriminates the two kinds of row the transactional outbox carries, so the relay routes each to the correct publisher.