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.

CascadeMode.StopOnFirstFailure why is going to be removed?

See original GitHub issue

Hi, My FluentValidation ver. is 9.1.3 for .NET Core Why are you going to remove CascadeMode.StopOnFirstFailure completely? As I read: https://docs.fluentvalidation.net/en/latest/conditions.html#stop-vs-stoponfirstfailure the behaviour of CascadeMode.Stop is completely different and I want to stop validation for a particular rule chain, nor for all next rules. If you remove StopOnFirstFailure I wouldn’t have such possibility…Maybe better is to leave both options in future? Or you can advise me how to achieve my goal using Stop? RuleFor(x => x.Surname).Cascade(CascadeMode.StopOnFirstFailure).NotNull().NotEqual("foo"); RuleFor(x => x.Forename).Cascade(CascadeMode.StopOnFirstFailure).NotNull().NotEqual("foo") When I change to Stop then if any Surname chain rule fails it will not check Forename at all - I want to stop only in particular chain rule (as it was in the example code). Is it possible?!

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
JeremySkinnercommented, Oct 6, 2020

The feature is not being removed. It will continue to work in 10.0, and will generate a warning, just as it does now.

1reaction
PatryxCSharkcommented, Aug 21, 2020

Hi, You’re right, I misunderstood the changes. Now it seems to be clear for me. Thank you for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Setting the Cascade mode
StopOnFirstFailure is still available as of version 11 and has no breaking changes to how it functions. However, in a future version, it...
Read more >
Using CascadeMode.StopOnFirstFailure on a validator level
From the FluentValidation documentation I learned that I can abort validation by setting the cascade mode. RuleFor(x => x.Surname) .Cascade( ...
Read more >
ASP .NET Core API – Fluent Validations – Cascade ...
The class level cascade mode decides if next rule should be evaluated if a rule has failed. It has nothing to do with...
Read more >
FluentValidation 9.1 released - Jeremy Skinner
The existing StopOnFirstFailure option will remain unchanged for backwards compatibility, but has been marked as deprecated.
Read more >
Using Fluent Validation in ASP.NET Core
In this article, we will talk about Fluent Validation and its implementation in ... Now, remove the FirstName and leave it blank. ......
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