Fluent.Unions.FluentValidation 1.1.0

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

Fluent.Unions

Fluent.Unions.FluentValidation

NuGet Downloads Publish Documentation

Runs a FluentValidation validator and returns the outcome as a Result<T>, so an existing validator plugs into a result pipeline. It builds on Fluent.Unions.

Installation

dotnet add package Fluent.Unions.FluentValidation

Usage

Validate an instance. Every failure ends up in one ValidationErrors with one ValidationError per failure, named after its property. A validator that throws gives the exception as the error.

using FluentValidation;
using Fluent.Unions.FluentValidation;

var validator = new PlaceOrderValidator();

Result<PlaceOrder> command = validator.ValidateToResult(new PlaceOrder(Guid.Empty, 0));
// error: ValidationErrors with two ValidationError (CustomerId, Quantity)

Validate a result inside a pipeline. An error is passed on and the validator is not called.

Result<PlaceOrder> parsed = ParseCommand(request);
Result<PlaceOrder> checkedCommand = await parsed.ValidateAsync(validator, cancellationToken);

With your own result type

Validate(validator) works on your own result type without type arguments. ValidateToResult returns the default Fluent.Unions.Result<T>, so start with Result.From(value).Validate(validator) instead. Without map, a failure goes through FromException. With map, an error type that is data gets every failure. See your own result type.

Result<PlaceOrder> validated = Result.From(new PlaceOrder(Guid.Empty, 0)).Validate(validator);

Validate an Option<T> property only when it has a value. None is always valid.

this.RuleForSome(p => p.Nickname).NotEmpty().MaximumLength(20);

An endpoint that returns the error through Fluent.Unions.AspNetCore answers 400 with every message in errors.

Failures with Severity.Warning or Severity.Info also make the result an error.

Documentation

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

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
1.1.0 96 11/22/2026
1.0.0 97 11/21/2026
0.3.0 102 11/20/2026
0.2.0 103 11/19/2026
0.1.0 102 11/19/2026