You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FluentValidationValidator does not allow adding failures to the failure collection. This is needed in the following scenario:
Scenario
Client is a Blazor web assembly app. Server is an API project. Both perform validations using fluent validation. Thus, an API request from the client might get a response containing a List<ValidationFailure>. If it were possible to add these (backend) failures to the current collection, the UI would be updated accordingly (e.g. coloring the related fields in red).
** Alternatives considered**
I considered extending the class FluentValidationValidator in my project. However LastValidationResult (the dictionary of failures) is an internal field, which prevents accessing it from external projects.
An alternative solution would be to make this field protected, making it possible to manipulate this collection in derived classes.
The text was updated successfully, but these errors were encountered:
FluentValidationValidator does not allow adding failures to the failure collection. This is needed in the following scenario:
Scenario
Client is a Blazor web assembly app. Server is an API project. Both perform validations using fluent validation. Thus, an API request from the client might get a response containing a
List<ValidationFailure>
. If it were possible to add these (backend) failures to the current collection, the UI would be updated accordingly (e.g. coloring the related fields in red).Proposed solution
A new method
** Alternatives considered**
I considered extending the class
FluentValidationValidator
in my project. HoweverLastValidationResult
(the dictionary of failures) is an internal field, which prevents accessing it from external projects.An alternative solution would be to make this field protected, making it possible to manipulate this collection in derived classes.
The text was updated successfully, but these errors were encountered: