I'm trying to emulate the behavior of the [ApiController]
attribute for model validation, however I'd like to return a JSON object I've made with the validation errors in an Error array within the JSON.
The challenge I'm facing is that I'm unsure how to access validation errors from within the Attribute and I'd like to use the attribute at the class level, so it will run on all controller methods without need of supplying the attribute for each action.
Any direction would be much appreciated.
edit: linked duplicate is how to create custom attribute. I'm looking how to access model validation errors from within an attribute.