Skip to main content
.NET 7 · .NET 8 · .NET 9

Vali-Validation

// fluent validation for .NET

4packages
80+built-in rules
.NET7 · 8 · 9
$dotnet add package Vali-Validation

Everything you need for validation

Built for .NET developers who value clarity and correctness.

01

Fluent API

Chain rules in a readable, expressive way. RuleFor, RuleForEach, SetValidator — compose validators at any depth.

02

Zero Dependencies

No external packages. Only Microsoft.Extensions.DependencyInjection.Abstractions for DI — keeps your dependency tree clean.

03

Async First

MustAsync, DependentRuleAsync, ValidateAsync — full async/await support. Query databases inside validators without deadlocks.

04
🌐

ASP.NET Core Ready

Middleware, endpoint filters and action filters. Delivers RFC 7807 problem+json responses out of the box.

05

Mediator Integration

First-class pipeline behaviors for MediatR and Vali-Mediator. Validation failures return Result<T>.Fail instead of throwing.

06

80+ Built-in Rules

Strings, numbers, dates, collections, passwords, IBAN, GUID, IP, IBAN, RuleSwitch, SwitchOn — all included.

Simple, expressive API

Register once, compose freely. Each rule is chainable and independently testable.

CreateUserValidator.cs
1234567891011121314151617
builder.Services.AddValidatorsFromAssembly(typeof(Program).Assembly);
public class CreateUserValidator : AbstractValidator<CreateUserCommand>
{
public CreateUserValidator()
{
RuleFor(x => x.Email)
.NotEmpty()
.EmailAddress()
.MaxLength(256);
RuleFor(x => x.Age)
.GreaterThan(17);
RuleFor(x => x.Password)
.NotEmpty()
.Password();
}
}

Choose your integration

4 NuGet packages — install only what you need.

Core library. All rules, validators, and DI registration.

dotnet add package Vali-Validation

Middleware, Minimal API filters, MVC action filters.

dotnet add package Vali-Validation.AspNetCore

MediatR pipeline behavior. Throws on validation failure.

dotnet add package Vali-Validation.MediatR

Vali-Mediator behavior. Returns Result<T>.Fail instead of throwing.

dotnet add package Vali-Validation.ValiMediator
FM

Built by

Felipe Montenegro

.NET developer and open-source contributor. Also the author of Vali-Mediator.