Reputation: 25
I have a Blazor (server side) project that uses a couple of EditForms. In each case the data model happens to include a nested object that is not needed in the form. I find that the form will fail validation if that object is deemed invalid, but without any explanation. Is there a way that I can examine the form's specific reason for deciding that a submit event is invalid?
Thanks!
Upvotes: 1
Views: 946
Reputation: 151
Simon, check this information microsoft docs, about
ObjectGraphDataAnnotationsValidator, ValidateComplexType
When you put attribute(ValidateComplexType) on your nested objects and replace "DataAnnotationsValidator" with "ObjectGraphDataAnnotationsValidator " you will see the error information for your nested objects, after everything in your primary edit form is valid.
Upvotes: 1