Trellis.Mediator.FluentValidation 3.0.0-alpha.721

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

Trellis.Mediator.FluentValidation

NuGet Package

Mediator pipeline adapter that plugs FluentValidation validators into the Trellis.Mediator validation stage.

Why this package exists

Trellis.FluentValidation is a Domain-layer concern — it converts FluentValidation ValidationResult to Result<T> for use in any application layer. Trellis.Mediator is an application / composition-layer concern — it provides the mediator pipeline behaviors (validation, authorization, logging, etc.).

This package bridges the two without forcing Domain projects to take a transitive Mediator dependency. Reference it from your Application (or composition root) project; keep Trellis.FluentValidation in your Domain project.

Installation

dotnet add package Trellis.Mediator.FluentValidation

Quick Example

using FluentValidation;
using Trellis.Mediator;
using Trellis.Mediator.FluentValidation;

builder.Services.AddMediator(opts => opts.ServiceLifetime = ServiceLifetime.Scoped);
builder.Services.AddTrellisBehaviors();
builder.Services.AddTrellisFluentValidation();
builder.Services.AddScoped<IValidator<MyCommand>, MyCommandValidator>();

AddTrellisFluentValidation() registers FluentValidationMessageValidatorAdapter<TMessage> as the open-generic IMessageValidator<TMessage> implementation. Every IValidator<T> registered for the message in DI runs inside the existing ValidationBehavior<TMessage, TResponse> and contributes its failures to an aggregated Error.InvalidInput response. FluentValidation property names with member chains (Address.City) or indexers (Items[0].Sku) are translated to camelCase RFC 6901 JSON Pointers (/address/city, /items/0/sku).

Key Features

  • Plugs into the existing Trellis validation behavior instead of adding another pipeline stage.
  • Aggregates all registered validator failures into one Error.InvalidInput.
  • Normalizes member chains and indexers to RFC 6901 JSON Pointers.
  • Supports an AOT-safe parameterless registration with explicit validators.

AOT / trim story

The parameterless AddTrellisFluentValidation() overload is AOT- and trim-safe — it uses open-generic DI registration with no reflection. Validators must be registered explicitly:

services.AddScoped<IValidator<CreateOrderCommand>, CreateOrderCommandValidator>();

The AddTrellisFluentValidation(params Assembly[]) overload scans assemblies for IValidator<T> implementations via reflection and is annotated [RequiresUnreferencedCode] / [RequiresDynamicCode] — use the parameterless form in AOT scenarios.

Documentation

Part of Trellis

This package is part of the Trellis framework.

Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

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

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.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.0-alpha.721 85 11/15/2026
3.0.0-alpha.582 93 10/19/2026
3.0.0-alpha.574 227 10/14/2026
3.0.0-alpha.571 71 10/13/2026
3.0.0-alpha.557 120 10/8/2026
3.0.0-alpha.554 78 10/8/2026
3.0.0-alpha.553 70 10/7/2026
3.0.0-alpha.542 130 10/5/2026
3.0.0-alpha.539 76 10/4/2026
3.0.0-alpha.532 110 10/2/2026
3.0.0-alpha.527 99 10/1/2026
3.0.0-alpha.526 71 9/30/2026
3.0.0-alpha.524 74 9/27/2026
3.0.0-alpha.520 88 9/25/2026
3.0.0-alpha.516 244 9/22/2026
3.0.0-alpha.513 82 9/22/2026
3.0.0-alpha.505 202 9/13/2026
3.0.0-alpha.495 258 8/24/2026
3.0.0-alpha.458 190 8/19/2026
3.0.0-alpha.455 149 8/19/2026
Loading failed