Trellis.EntityFrameworkCore 3.0.0-alpha.382

This is a prerelease version of Trellis.EntityFrameworkCore.
dotnet add package Trellis.EntityFrameworkCore --version 3.0.0-alpha.382
                    
NuGet\Install-Package Trellis.EntityFrameworkCore -Version 3.0.0-alpha.382
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Trellis.EntityFrameworkCore" Version="3.0.0-alpha.382" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Trellis.EntityFrameworkCore" Version="3.0.0-alpha.382" />
                    
Directory.Packages.props
<PackageReference Include="Trellis.EntityFrameworkCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Trellis.EntityFrameworkCore --version 3.0.0-alpha.382
                    
#r "nuget: Trellis.EntityFrameworkCore, 3.0.0-alpha.382"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Trellis.EntityFrameworkCore@3.0.0-alpha.382
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Trellis.EntityFrameworkCore&version=3.0.0-alpha.382&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Trellis.EntityFrameworkCore&version=3.0.0-alpha.382&prerelease
                    
Install as a Cake Tool

Trellis.EntityFrameworkCore

NuGet Package

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> or Result from 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 failed Result<TEntity> carrying an Error.Conflict with reason code "duplicate.key" and the provider-extracted ConstraintName / ConstraintTableName telemetry fields, so worker outboxes and "save unless exists" deduplication never throw on redelivery.
  • Cursor-based seek pagination via IQueryable<T>.ToPageAsync(pageSize, cursor, keySelector, …) — returns Result<Page<T>>, composes with PageBuilder and CursorCodec, 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 on Result.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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 109 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
Loading failed