Quantcast
Channel: Fluent Validation for .NET
Viewing all articles
Browse latest Browse all 1917

New Post: RuleSets with two abstract validators.

$
0
0

Hi 

Rulesets are designed to cascade through to child validators - there isn't a way to change this behaviour out of the box. However, you could write your own IValidatorSelector implementation that excludes the ruleset check for child validators.

The default implementation of the RulesetValidatorSelector is here: https://github.com/JeremySkinner/FluentValidation/blob/master/src/FluentValidation/Internal/RulesetValidatorSelector.cs

You could modify this to always run rules if they're inside a child validator.

 

Jeremy


Viewing all articles
Browse latest Browse all 1917

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>