FluentValidation v8.5.0 Release Notes
Release Date: 2019-09-24 // over 4 years ago-
๐ Release notes
- โ Add support for ASP.NET Core 3.
- โ Add ASP.NET Core-compatible version of the email address validator.
- โ Simplify the advanced test-helper syntax.
- โ Add support for defining child rules inline when using
RuleForEach
. ValidatorDescriptor
now has consistent handling of model-level rules.RuleForEach
can now access collection index in error message with{CollectionIndex}
placeholder.- ๐ Welsh language translations of default error messages.
- ๐ Hungrian language translations of default error messages.
- ๐ Indonesian language translations of default error messages.
- Using
RuleForEach
combined withWhen
has more intuitive behaviour. - ๐ Fixed order of rule execution when using async validation.
Of these new features, the main one to note is the new
ChildRules
syntax. When defining a rule against a collection of complex types, rules for the child properties can be defined directly inline rather than having to use a child validator:public class CustomerValidator : AbstractValidator\<Customer\> { public CustomerValidator() { RuleForEach(x =\> x.Orders).ChildRules(order =\> { order.RuleFor(x =\> x.ProductName).NotNull(); order.RuleFor(x =\> x.Amount).GreaterThan(0); }); } }
Downloads
Binaries can be downloaded from nuget:
- ๐ฆ FluentValidation - Main package
- ๐ฆ FluentValidation.AspNetCore - ASP.NET Core integration
- ๐ฆ FluentValidation.WebApi - Legacy ASP.NET Web Api 2 integration (deprecated)
- ๐ฆ FluentValidation.Mvc5 - Legacy ASP.NET MVC 5 integration (deprecated)