Quantcast
Channel: User Pure.Krome - Stack Overflow
Viewing all articles
Browse latest Browse all 73

How can I create a RuleSet with a .NET FluentValidation InlineValidator?

$
0
0

I'm creating an InlineValidator (from the FluentValidation nuget package/library).

var validator = new InlineValidator<Person>;validator.RuleFor(x => x.Surname).NotNull();validator.RuleSet("someRuleSet", () => {    // ?????            });

When I try to call the RuleSet method in there, it seems to not compile.

How can I create a RuleSet against an InlineValidator please ?

Here's the example ruleset i'm trying...

.RuleSet("someRuleSet", () =>{    RuleFor(x => x.Name).NotNull();    RuleFor(x => x.Age).NotEqual(0);}

Viewing all articles
Browse latest Browse all 73

Trending Articles



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