Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PreValidate Error not thrown on ValidateAndThrow if return value is "false" #1736

Closed
matthiaslischka opened this issue May 12, 2021 · 1 comment
Milestone

Comments

@matthiaslischka
Copy link
Contributor

FluentValidation version

10.1.0

ASP.NET version

.Net Core 3.1

Summary

When adding an error in PreValidate the ValidateAndThrow() method does only throw when PreValidate returns true. Not when it returns false.

This is very unexpected and probably an oversight. The validation failed and the method should throw.
https://docs.fluentvalidation.net/en/latest/advanced.html#prevalidate

BR Matthias

Steps to Reproduce

No response

@JeremySkinner
Copy link
Member

JeremySkinner commented May 12, 2021

Thanks for reporting this, I’ll look at getting that changed for a future version.

@JeremySkinner JeremySkinner added this to the 10.2 milestone May 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants