Validate same object with a different validator #239
Unanswered
AlexHolmes4
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a form that has 5 pages and I use the same object shared across.
DI obviously cant figure out which validator to provide back as its the same object for each.
That leaves me with
Where you manually assign the validator to use.
The issue I faced here is now the validation is completed in a manner than always expects the ModelContext provided, but using some component libraries inputs breaks it and I can only assume its due to #204.
(Telerik Editor component, on Format dropdown change throws exception that FluentValidator expected Object of type X but received DisplayObject32).
My options are;
Create DTO for each page and split my object up, rebuild on save/submit.
Workaround I came up with;
workaround:
Anyone see any big flaws with this approach? cheers
Beta Was this translation helpful? Give feedback.
All reactions