-
Notifications
You must be signed in to change notification settings - Fork 11
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
TryValidateModel
does not work as expected
#53
Comments
icnocop
added a commit
to icnocop/FluentValidation.AutoValidation
that referenced
this issue
Jan 19, 2025
icnocop
added a commit
to icnocop/FluentValidation.AutoValidation
that referenced
this issue
Jan 19, 2025
icnocop
added a commit
to icnocop/FluentValidation.AutoValidation
that referenced
this issue
Jan 19, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi.
When integrating with ASP.NET Core MVC, a call to
TryValidateModel
does not work as expected.In my actual scenario,
ModelState.Entries
is18
andModelState.IsValid
isfalse
when the action method is called, as expected.ModelState.Clear()
will setEntries
to0
andIsValid
totrue
, as expected.When using
FluentValidation.AspNetCore
, a call toTryValidateModel(viewModel);
will re-evaluate the model and setModelState.Entries
to18
andModelState.IsValid
tofalse
, for example.I expected
SharpGrip.FluentValidation.AutoValidation
to do the same, butEntries
is0
andIsValid
istrue
, as if the view model was not re-evaluated/validated, which is unexpected.Thank you.
The text was updated successfully, but these errors were encountered: