PouryaKit.Validation 0.1.0-preview.2

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

PouryaKit.Validation

NuGet .NET 10 License: MIT

PouryaKit.Validation

FluentValidation validators for commands and queries, run as one step of the Kit's fixed pipeline. Each validator sits beside its Feature, and every failure of every validator comes back as one failed Result, its Errors naming the input they are about, before the handler runs.

Install

dotnet add package PouryaKit.Validation --prerelease

When to use it

  • A command's or query's input needs checking before its handler runs.
  • A paged query must refuse a size, sort or filter it did not declare.

It plugs into PouryaKit.Cqrs, whose pipeline runs it, and PouryaKit.Web answers its Errors in a problem response, each naming its input.

Quick start

Register the Module's validators in its Composition Root:

module.AddPouryaKitValidation();

Write one validator per command or query that needs input checks, beside it in the Feature, as the Proving Sample does:

internal sealed class CreateProductCommandValidator : AbstractValidator<CreateProductCommand>
{
    public CreateProductCommandValidator()
    {
        RuleFor(command => command.ProductId).NotEmpty();
        RuleFor(command => command.CategoryId).NotEmpty();
        RuleFor(command => command.Name).NotEmpty().MaximumLength(200);
    }
}

What you get

  • One validation step, in its fixed place in the pipeline, so a handler sees only input that passed.
  • Every failure at once, as Errors in the Result; nothing throws.
  • Validators found in the Module's own assembly, internal ones included.
  • Rules for a Page's size, sort and filter.

Validate the input's shape here. A business rule that depends on state belongs in the aggregate, where it returns an Error.

Learn more

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

Showing the top 1 NuGet packages that depend on PouryaKit.Validation:

Package Downloads
PouryaKit.Reporting.Module

The Kit's report Module: report jobs generated in the background, stored through the Host's file storage and served to their requester by a time-limited link.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.2 76 11/1/2026
0.1.0-preview.1 80 10/31/2026
0.1.0-preview.0.28 72 10/26/2026