Validation using "Fluent Validation"

0
0

Good evening to all the WiseJ developers,
I have a question about using a validation framework.
Are there developers in this forum who have integrated the famous framework “FluentValidation” (https://docs.fluentvalidation.net/) into the WiseJ UI as dynamically as possible?
The validation in the backend is extensively documented, but I can’t find a dynamic approach to use the Validate() events in combination with the ErrorProvider to display the appropriate error messages per control.

I am very happy about every tip, link or approach.

The available examples always refer to ASP.NET Core / ASP.NET MVC.

Many thanks!

Jan Brandenburger

  • Tim Larson
    I have used fluent validation and I also ran into it’s limitations of not really being dynamic. I have started using Microsoft Rules Engine which is very promising. https://github.com/microsoft/RulesEngine You can set your rules in JSON and compare it. It also has warnings and errors which helped fit my needs.
  • Jan Brandenburger
    Hi Tim, thanks for your answer. I’m already interested in how others solve the validation. Because writing the same code in every mask cannot be clean. So I thought that FluentValidation is an approach that completely seperates validation from the UI.
  • You must to post comments
0
0

Here is the example.
For explanation:
(1) I use the framework “FluentValidation”.
(2) I have written a PersonValidator.
(3) I use the BindingSource.

The code is only an example and should be refactored in any case!

Every hint and suggestion for improvement is welcome.

  • You must to post comments
0
0

I have found an approach. This one is certainly not perfect, but it works at first.
I will translate it into english and then put it here. Maybe there will be suggestions for improvement from members of the forum.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.