Trellis.ServiceDefaults
3.0.0-alpha.304
See the version list below for details.
dotnet add package Trellis.ServiceDefaults --version 3.0.0-alpha.304
NuGet\Install-Package Trellis.ServiceDefaults -Version 3.0.0-alpha.304
<PackageReference Include="Trellis.ServiceDefaults" Version="3.0.0-alpha.304" />
<PackageVersion Include="Trellis.ServiceDefaults" Version="3.0.0-alpha.304" />
<PackageReference Include="Trellis.ServiceDefaults" />
paket add Trellis.ServiceDefaults --version 3.0.0-alpha.304
#r "nuget: Trellis.ServiceDefaults, 3.0.0-alpha.304"
#:package Trellis.ServiceDefaults@3.0.0-alpha.304
#addin nuget:?package=Trellis.ServiceDefaults&version=3.0.0-alpha.304&prerelease
#tool nuget:?package=Trellis.ServiceDefaults&version=3.0.0-alpha.304&prerelease
Trellis.ServiceDefaults
Opinionated composition defaults for Trellis web services.
Installation
dotnet add package Trellis.ServiceDefaults
Quick Example
using Trellis.ServiceDefaults;
builder.Services.AddTrellis(options => options
.UseAsp()
.UseMediator()
.UseFluentValidation(typeof(Program).Assembly)
.UseClaimsActorProvider()
.UseResourceAuthorization(typeof(Program).Assembly)
.UseEntityFrameworkUnitOfWork<AppDbContext>());
UseEntityFrameworkUnitOfWork<TContext>() is always applied last so the transactional command behavior runs innermost. AddDbContext<TContext>(...) and AddMediator(...) remain application-owned registrations.
UseFluentValidation() and UseResourceAuthorization() both support no-assembly calls for explicit, no-scanning composition; pass assemblies only when you want Trellis to discover validators/resource loaders automatically.
AOT compatibility
Trellis.ServiceDefaults is not AOT- or trim-compatible. The fluent assembly-scanning methods (UseFluentValidation(asm), UseResourceAuthorization(asm), UseDomainEvents(asm)) wrap underlying [RequiresUnreferencedCode] + [RequiresDynamicCode] APIs without propagating the attributes. For AOT consumers, use the per-package direct APIs (services.AddTrellisFluentValidation() + explicit validator registrations, services.AddResourceAuthorization<TMessage, TResource, TResponse>(), services.AddDomainEventDispatch() + services.AddDomainEventHandler<TEvent, THandler>()).
The parameterless o.UseFluentValidation() / o.UseResourceAuthorization() / o.UseDomainEvents() overloads are AOT-compatible — they only register the adapter / pipeline behaviors and rely on the consumer's explicit per-type registrations.
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
- Trellis.Asp (>= 3.0.0-alpha.304)
- Trellis.EntityFrameworkCore (>= 3.0.0-alpha.304)
- Trellis.FluentValidation (>= 3.0.0-alpha.304)
- Trellis.Mediator (>= 3.0.0-alpha.304)
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.385 | 47 | 6/15/2026 |
| 3.0.0-alpha.382 | 44 | 6/12/2026 |
| 3.0.0-alpha.372 | 55 | 6/10/2026 |
| 3.0.0-alpha.360 | 77 | 6/7/2026 |
| 3.0.0-alpha.342 | 67 | 6/5/2026 |
| 3.0.0-alpha.337 | 48 | 6/3/2026 |
| 3.0.0-alpha.336 | 49 | 6/3/2026 |
| 3.0.0-alpha.304 | 57 | 5/29/2026 |