question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StopOnFirstFailure dont interrupt on failed DependentRules

See original GitHub issue

System Details

  • FluentValidation version: 8.0.100
  • Web Framework version: Asp.NET Core 2.1

Issue Description

I tried to chained multiple dependent rules into a complex validator, like this RuleFor(...) .Cascade(CascadeMode.StopOnFirstFailure) .NotEmpty() .DependentRules(()=>...) .DependentRules(()=>...)

but when the first dependent rules fail the second is still executed, is it a way to interrupt next a failed dependent rules ?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JeremySkinnercommented, Feb 6, 2019

Yes that’s something that we can look at adding in the future.

0reactions
DavidDurighellocommented, Feb 6, 2019

Thanks for the solution, i find an other way, but i keep that in mind. I think that will be a good new feature to chain DependentRules, if it’s possible. What do you think ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

StopOnFirstFailure dont interrupt on failed DependentRules
Issue Description. I tried to chained multiple dependent rules into a complex validator, like this RuleFor(...) .Cascade(CascadeMode.
Read more >
Stop Fluent Validation on first failure
Just check for null before running the rules that depend on them, using a When condition. this.CascadeMode = CascadeMode.StopOnFirstFailure ...
Read more >
Setting the Cascade mode
StopOnFirstFailure option was used to provide control over the default cascade mode at rule-level, but its use was not intuitive. There was no...
Read more >
Fluentvalidation Stop On First Error
DependentRules(() => { by using FluentValidation rules to define Swagger schema in ASP. ... Stop on first failure · Issue #1224 · FluentValidation....
Read more >
Fluent validation child rules. Information required ...
Multiple Dependent Rules FluentValidation. StopOnFirstFailure because it always checks for first validation failure and stop validating others.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found