Koto.Validation 0.1.0-preview.5

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

Koto.Validation

FluentValidation v7 extensions and a CQRS pipeline behavior for the Koto suite.

Uses FluentValidation v7 (Apache 2.0). v8+ switched to a commercial license and is not used.

Install

dotnet add package Koto.Validation

What's included

Type Purpose
KotoValidators.MustBeValueObject<T> Validates that a string can construct a ValueObject-derived type
KotoValidators.MustBeEntity<T> Validates a strongly-typed entity reference
KotoValidators.ListMustContainNumberOfItems Min/max count rule for collections
ValidationBehavior<TRequest, TResponse> Pipeline middleware — runs all validators before the handler
ServiceCollectionExtensions.AddKotoValidation Registers the behavior and scans assemblies for validators

Usage

Register

builder.Services.AddKotoValidation(typeof(Program).Assembly);
// Also add to your pipeline:
services.AddScoped(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));

Write a validator

public sealed class PlaceOrderValidator : AbstractValidator<PlaceOrderCommand>
{
    public PlaceOrderValidator()
    {
        RuleFor(x => x.Items).ListMustContainNumberOfItems(1, 100);
        RuleFor(x => x.CustomerId).NotEmpty();
    }
}

If validation fails, ValidationBehavior returns a Result<T>.Failure with the first validation error — no exceptions thrown.

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

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
0.1.0-preview.5 36 5/13/2026
0.1.0-preview.4 32 5/13/2026
0.1.0-preview.3 31 5/13/2026
0.1.0-preview.2 44 5/11/2026