Trellis.ServiceDefaults
3.0.0-alpha.574
dotnet add package Trellis.ServiceDefaults --version 3.0.0-alpha.574
NuGet\Install-Package Trellis.ServiceDefaults -Version 3.0.0-alpha.574
<PackageReference Include="Trellis.ServiceDefaults" Version="3.0.0-alpha.574" />
<PackageVersion Include="Trellis.ServiceDefaults" Version="3.0.0-alpha.574" />
<PackageReference Include="Trellis.ServiceDefaults" />
paket add Trellis.ServiceDefaults --version 3.0.0-alpha.574
#r "nuget: Trellis.ServiceDefaults, 3.0.0-alpha.574"
#:package Trellis.ServiceDefaults@3.0.0-alpha.574
#addin nuget:?package=Trellis.ServiceDefaults&version=3.0.0-alpha.574&prerelease
#tool nuget:?package=Trellis.ServiceDefaults&version=3.0.0-alpha.574&prerelease
Trellis.ServiceDefaults
An ordered composition root for Trellis services. Configure authorization, validation, EF Core transactions, outbox, inbox, idempotency, and integration events in one fluent call.
Installation
dotnet add package Trellis.ServiceDefaults
Quick Example
using Trellis.ServiceDefaults;
builder.Services.AddTrellis(trellis => trellis
.UseAsp()
.UseScalarValueValidation()
.UseProblemDetails()
.UseMediator()
.UseFluentValidation(typeof(Program).Assembly)
.UseClaimsActorProvider()
.UseResourceAuthorization(typeof(Program).Assembly)
.UseEntityFrameworkUnitOfWork<AppDbContext>());
Call AddTrellis(...) once. If omitted, the composition features are intentionally not registered.
Key Features
- Applies Trellis registrations in canonical pipeline order.
- Existing Mediator/resource slots automatically install the dispatch authorization context: static/resource stages and actor-aware handlers share one checked Actor reference. No new actor-handler toggle is needed.
- Keeps feature selection explicit and discoverable at the application composition root.
- Provides slots for ASP.NET Core, authorization, FluentValidation, EF Core unit of work, outbox, inbox, idempotency, and events.
- Preserves package-specific options through focused
UseXxx(...)methods. - Existing actor/cache/worker slots preserve identity-only resolution. Supported
UseCachingActorProvider<T>()binds both contracts to one scoped wrapper with independent lazy caches; custom providers/subclasses opt in explicitly. - Leaves vendor stores and transport adapters in their owning packages, avoiding unnecessary SDK dependencies.
For most applications, use the builder instead of mixing standalone AddTrellis* calls. Provider-specific stores and adapters remain separate registrations by design.
Every UseIntegrationEvents(...) overload wires the default best-effort local publisher when none is registered. It logs and swallows ordinary consumer failures, so processed integration outbox rows do not retry those consumers. For reliable broker handoff, replace the publisher with an adapter that awaits acceptance and propagates publication failures; acceptance is not consumer success. UseInbox<TContext>() supplies a separate non-swallowing consumption seam, not automatic routing: an adapter must call IInboxDispatcher.DispatchAsync with the stable message id and expose failures for redelivery.
UseOutboxReadiness<TContext>(OutboxReadinessOptions.CreateStagedOperationalProfile())
explicitly enables the named trellis-outbox read-only health check alongside
UseOutbox<TContext>(). Existing outbox/inbox slots do not enable it. Endpoint
authorization and traffic-readiness versus alerting remain host-owned; capture age and
consumer lag remain deferred. See outbox readiness.
For a separate worker, pass
OutboxReadinessOptions.CreateMetadataOnlyProfile(workerMaxAttempts) to the same slot
in the API, without UseOutbox. Match WorkerMaxAttempts to the worker's retry policy
using one configuration key. Local options are ignored without comparison or warning.
Metadata-only cannot detect a dead low-volume worker; capture age remains deferred.
Generic Host lifecycle startup validates local-mode relay configuration before services
start; bare service providers do not run that validation.
Common HttpContext.PageUrl(...) builders require no versioning SDK. Versioned hosts
install Trellis.Asp.ApiVersioning and configure the existing
UseAsp(asp => asp.UseVersionedPageUrls()) callback alongside normal API-versioning
registration; ServiceDefaults itself remains versioning-independent.
Native AOT hosts with struct Result<T> responses need the literal closed-generator
pipeline
and direct typed resource registrations, without UseMediator or slots that imply it:
native DI cannot dynamically close open behaviors over value-type responses.
Documentation
| 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
- FluentValidation (>= 12.1.1)
- Mediator.Abstractions (>= 3.0.2)
- Microsoft.EntityFrameworkCore (>= 10.0.12)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.DependencyModel (>= 10.0.12)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- OpenTelemetry.Api (>= 1.19.1)
- Trellis.Asp (>= 3.0.0-alpha.574)
- Trellis.EntityFrameworkCore (>= 3.0.0-alpha.574)
- Trellis.EntityFrameworkCore.Inbox (>= 3.0.0-alpha.574)
- Trellis.EntityFrameworkCore.Outbox (>= 3.0.0-alpha.574)
- Trellis.Mediator (>= 3.0.0-alpha.574)
- Trellis.Mediator.FluentValidation (>= 3.0.0-alpha.574)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-alpha.574 | 50 | 10/14/2026 |
| 3.0.0-alpha.571 | 45 | 10/13/2026 |
| 3.0.0-alpha.557 | 89 | 10/8/2026 |
| 3.0.0-alpha.554 | 53 | 10/8/2026 |
| 3.0.0-alpha.553 | 50 | 10/7/2026 |
| 3.0.0-alpha.542 | 112 | 10/5/2026 |
| 3.0.0-alpha.539 | 57 | 10/4/2026 |
| 3.0.0-alpha.532 | 58 | 10/2/2026 |
| 3.0.0-alpha.527 | 55 | 10/1/2026 |
| 3.0.0-alpha.526 | 61 | 9/30/2026 |
| 3.0.0-alpha.524 | 62 | 9/27/2026 |
| 3.0.0-alpha.520 | 64 | 9/25/2026 |
| 3.0.0-alpha.516 | 148 | 9/22/2026 |
| 3.0.0-alpha.513 | 57 | 9/22/2026 |
| 3.0.0-alpha.505 | 67 | 9/13/2026 |
| 3.0.0-alpha.495 | 129 | 8/24/2026 |
| 3.0.0-alpha.458 | 111 | 8/19/2026 |
| 3.0.0-alpha.455 | 128 | 8/19/2026 |
| 3.0.0-alpha.449 | 80 | 8/18/2026 |
| 3.0.0-alpha.447 | 78 | 8/18/2026 |