Trellis.EntityFrameworkCore
3.0.0-alpha.382
dotnet add package Trellis.EntityFrameworkCore --version 3.0.0-alpha.382
NuGet\Install-Package Trellis.EntityFrameworkCore -Version 3.0.0-alpha.382
<PackageReference Include="Trellis.EntityFrameworkCore" Version="3.0.0-alpha.382" />
<PackageVersion Include="Trellis.EntityFrameworkCore" Version="3.0.0-alpha.382" />
<PackageReference Include="Trellis.EntityFrameworkCore" />
paket add Trellis.EntityFrameworkCore --version 3.0.0-alpha.382
#r "nuget: Trellis.EntityFrameworkCore, 3.0.0-alpha.382"
#:package Trellis.EntityFrameworkCore@3.0.0-alpha.382
#addin nuget:?package=Trellis.EntityFrameworkCore&version=3.0.0-alpha.382&prerelease
#tool nuget:?package=Trellis.EntityFrameworkCore&version=3.0.0-alpha.382&prerelease
Trellis.EntityFrameworkCore
EF Core conventions and helpers for Trellis value objects, Maybe<T>, and Result-based persistence.
Installation
dotnet add package Trellis.EntityFrameworkCore
Quick Example
using Microsoft.EntityFrameworkCore;
using Trellis;
using Trellis.EntityFrameworkCore;
protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder) =>
configurationBuilder.ApplyTrellisConventions(typeof(AppDbContext).Assembly);
// Reflection-free alternative — generated at compile time, no assembly scan:
// configurationBuilder.ApplyTrellisConventionsFor<AppDbContext>();
Maybe<Customer> customer = await dbContext.Customers.FirstOrDefaultMaybeAsync(cancellationToken);
Result<int> saved = await dbContext.SaveChangesResultAsync(cancellationToken);
Key Features
- Apply Trellis value converters and owned-type conventions with one registration point.
- Query
Maybe<T>naturally instead of dropping to storage-specific null handling. - Return
Result<int>orResultfrom save operations instead of throwing on expected failures. - Idempotent inserts on a unique constraint via
db.TryInsertUniqueAsync(entity, ct)— duplicate-key violations surface as a failedResult<TEntity>carrying anError.Conflictwith reason code"duplicate.key"and the provider-extractedConstraintName/ConstraintTableNametelemetry fields, so worker outboxes and "save unless exists" deduplication never throw on redelivery. - Cursor-based seek pagination via
IQueryable<T>.ToPageAsync(pageSize, cursor, keySelector, …)— returnsResult<Page<T>>, composes withPageBuilderandCursorCodec, and never throws on malformed input. RepositoryBase<TAggregate, TId>— staging-only base class (Add/Remove/Query/Exists/Count).IUnitOfWork/EfUnitOfWork<TContext>— single commit boundary for staged changes.TransactionalCommandBehavior— Mediator pipeline behavior that auto-commits after successful command handlers (requires Mediator pipeline registration). Also commits onResult.FailAfterCommit<T>(error)outcomes so persist-on-failure handlers (e.g., a worker recording a permanent-failure transition) can stage state alongside the failed result.
Documentation
Part of Trellis
This package is part of the Trellis framework.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Mediator.Abstractions (>= 3.0.2)
- Microsoft.EntityFrameworkCore (>= 10.0.9)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.9)
- Trellis.Authorization (>= 3.0.0-alpha.382)
- Trellis.Core (>= 3.0.0-alpha.382)
- Trellis.Primitives (>= 3.0.0-alpha.382)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Trellis.EntityFrameworkCore:
| Package | Downloads |
|---|---|
|
Trellis.ServiceDefaults
Opinionated service composition defaults for Trellis web services. Provides a tiered builder that wires ASP integration, Mediator behaviors, FluentValidation, resource authorization, actor providers, and EF Core Unit of Work in canonical order. |
|
|
Trellis.EntityFrameworkCore.Outbox
Transactional outbox for Trellis. Atomically captures aggregate domain events to an EF Core table in the same transaction as the aggregate change, then relays them to Trellis domain-event handlers — durable, at-least-once, in-process dispatch. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-alpha.382 | 47 | 6/12/2026 |
| 3.0.0-alpha.372 | 44 | 6/10/2026 |
| 3.0.0-alpha.360 | 71 | 6/7/2026 |
| 3.0.0-alpha.342 | 74 | 6/5/2026 |
| 3.0.0-alpha.337 | 63 | 6/3/2026 |
| 3.0.0-alpha.336 | 51 | 6/3/2026 |
| 3.0.0-alpha.304 | 68 | 5/29/2026 |
| 3.0.0-alpha.158 | 110 | 4/5/2026 |
| 3.0.0-alpha.157 | 71 | 4/4/2026 |
| 3.0.0-alpha.140 | 74 | 3/30/2026 |
| 3.0.0-alpha.137 | 74 | 3/27/2026 |
| 3.0.0-alpha.135 | 59 | 3/26/2026 |
| 3.0.0-alpha.127 | 64 | 3/23/2026 |
| 3.0.0-alpha.123 | 67 | 3/19/2026 |
| 3.0.0-alpha.118 | 72 | 3/14/2026 |
| 3.0.0-alpha.111 | 64 | 3/12/2026 |
| 3.0.0-alpha.104 | 60 | 3/9/2026 |
| 3.0.0-alpha.100 | 62 | 3/4/2026 |
| 3.0.0-alpha.99 | 58 | 3/4/2026 |
| 3.0.0-alpha.98 | 67 | 3/3/2026 |