Trellis.Mediator 3.0.0-alpha.157

This is a prerelease version of Trellis.Mediator.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Trellis.Mediator --version 3.0.0-alpha.157
                    
NuGet\Install-Package Trellis.Mediator -Version 3.0.0-alpha.157
                    
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.Mediator" Version="3.0.0-alpha.157" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Trellis.Mediator" Version="3.0.0-alpha.157" />
                    
Directory.Packages.props
<PackageReference Include="Trellis.Mediator" />
                    
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.Mediator --version 3.0.0-alpha.157
                    
#r "nuget: Trellis.Mediator, 3.0.0-alpha.157"
                    
#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.Mediator@3.0.0-alpha.157
                    
#: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.Mediator&version=3.0.0-alpha.157&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Trellis.Mediator&version=3.0.0-alpha.157&prerelease
                    
Install as a Cake Tool

Trellis.Mediator

Result-aware pipeline behaviors for martinothamar/Mediator.

Provides validation, authorization, logging, tracing, and exception handling behaviors that understand Trellis Result<T> types and short-circuit correctly.

Authorization types (Actor, IActorProvider, IAuthorize, IAuthorizeResource<TResource>) live in the separate Trellis.Authorization package — use them with or without CQRS.

Behaviors

Behavior Purpose
ExceptionBehavior Catches unhandled exceptions → Error.Unexpected
TracingBehavior OpenTelemetry Activity with Result status
LoggingBehavior Structured logging with duration
AuthorizationBehavior Static permission checks (IAuthorize)
ResourceAuthorizationBehavior<,,> Loads resource, checks ownership (IAuthorizeResource<TResource>). Auto-discovered via AddResourceAuthorization(Assembly).
ValidationBehavior Self-validation via IValidate

Usage

services.AddMediator(options =>
{
    options.Assemblies = [typeof(MyCommand).Assembly];
    options.PipelineBehaviors = [.. ServiceCollectionExtensions.PipelineBehaviors];
});

// Auto-discover IAuthorizeResource<T> commands and IResourceLoader<,> implementations
services.AddResourceAuthorization(typeof(MyCommand).Assembly);

See the full documentation for details.

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 (3)

Showing the top 3 NuGet packages that depend on Trellis.Mediator:

Package Downloads
Trellis.FluentValidation

Convert fluent validation errors to Trellis Validation errors.

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.Testing.Worker

Integration-test harness for BackgroundService workers built on Trellis - prewired IHost, FakeTimeProvider, TestActorProvider, domain-event capture, and tick-completion primitives

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-alpha.337 0 6/3/2026
3.0.0-alpha.336 26 6/3/2026
3.0.0-alpha.304 67 5/29/2026
3.0.0-alpha.158 100 4/5/2026
3.0.0-alpha.157 68 4/4/2026
3.0.0-alpha.140 71 3/30/2026
3.0.0-alpha.137 79 3/27/2026
3.0.0-alpha.135 58 3/26/2026
3.0.0-alpha.127 58 3/23/2026
3.0.0-alpha.123 65 3/19/2026
3.0.0-alpha.118 70 3/14/2026
3.0.0-alpha.111 62 3/12/2026
3.0.0-alpha.104 80 3/9/2026
3.0.0-alpha.100 58 3/4/2026
3.0.0-alpha.99 61 3/4/2026
3.0.0-alpha.98 63 3/3/2026
3.0.0-alpha.95 61 3/2/2026
3.0.0-alpha.94 57 3/2/2026
3.0.0-alpha.93 65 3/1/2026
3.0.0-alpha.92 70 2/28/2026