FluentValidation v9.1.3 Release Notes

Release Date: 2020-08-19 // over 3 years ago
  • ๐Ÿš€ Release notes

    โฌ†๏ธ Please read the upgrade guide if you are moving from 8.x to 9.x

    ๐Ÿ”„ Changes in 9.1.3

    • ๐Ÿ›  Fix an issue with IncludeRulesNotInRuleSet not working correctly (#1493)

    ๐Ÿ”„ Changes in 9.1.2

    • ๐Ÿ‘‰ Make the ValidationContext.ThrowOnFailures getter public.

    ๐Ÿ”„ Changes in 9.1.1

    • โšก๏ธ Update incorrect wording in CascadeMode.StopOnFirstFailure deprecation warning.

    ๐Ÿ”„ Changes in 9.1.0

    • โž• Add new Validate extension methods that allow options to be configured using a strategy (#1467)
    • ๐Ÿ—„ Introduce CascadeMode.Stop and deprecate CascadeMode.StopOnFirstFailure to resolve confusion/abiguity about setting the cascade mode at validator-level (#1437)
    • ๐Ÿ‘ป RaiseValidationException can be overridden to customize the exception throwing process (#1162)
    • ๐Ÿ‘‰ Make ruleset separator character splitting consistent (#1424)
    • โœ… Transform now works with RuleForEach (#1450)
    • Introduce constants for rulesets (#1435)
    • ๐Ÿ”€ Resolve issue when attempting to use asynchronous conditions in a synchornous validaiton run (#1438)
    • โž• Added asynchronous versions of the TestHelper methods (#1423)

    Example of using the new validation strategy:

    // Validate specific rulesetsvalidator.Validate(instance, opt =\> { opt.IncludeRuleSets("MyRuleSet", "SomeOtherRuleSet"); // Can also force rules not in a ruleset to be runopt.IncludeRulesNotInRuleSet(); });// Validate specific propertiesvalidator.Validate(instance, opt =\> { opt.IncludeProperties("Forename", "Surname"); // oropt.IncludeProperties(x =\> x.Surname, x.Forename); });// Throw exceptions on failurevalidator.Validate(instance, opt =\> { opt.ThrowOnFailures(); });// Combine various optionsvalidator.Validate(instance, opt =\> { opt.IncludeRuleSets("MyRuleSet", "SomeOtherRuleSet").IncludeRulesNotInRuleSet(); opt.ThrowOnFailures(); });
    

    Downloads

    Binaries can be downloaded from nuget: