Everything you need for validation
Built for .NET developers who value clarity and correctness.
Fluent API
Chain rules in a readable, expressive way. RuleFor, RuleForEach, SetValidator — compose validators at any depth.
Zero Dependencies
No external packages. Only Microsoft.Extensions.DependencyInjection.Abstractions for DI — keeps your dependency tree clean.
Async First
MustAsync, DependentRuleAsync, ValidateAsync — full async/await support. Query databases inside validators without deadlocks.
ASP.NET Core Ready
Middleware, endpoint filters and action filters. Delivers RFC 7807 problem+json responses out of the box.
Mediator Integration
First-class pipeline behaviors for MediatR and Vali-Mediator. Validation failures return Result<T>.Fail instead of throwing.
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.
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-ValidationMiddleware, Minimal API filters, MVC action filters.
dotnet add package Vali-Validation.AspNetCoreMediatR pipeline behavior. Throws on validation failure.
dotnet add package Vali-Validation.MediatRVali-Mediator behavior. Returns Result<T>.Fail instead of throwing.
dotnet add package Vali-Validation.ValiMediator