1

I have same issue as mentioned in this question long back. Return Custom ValidationResult and access it from controller in Asp.Net Core

But it didn't concluded with an answer. Please suggest a way to get CustomValidationResult into ModelState of controller. Note: I am not trying to create new action filters. i am trying to work with ValidationResult, ValidationAttribute and ModelState.

i created a class for

CustomValidationResult : ValidationResult

Using this in my custom attribute

Mandatory : RequiredAttribute

This is not reflecting back to controller level ModelState for further validation.

  • could you pls give more details? such as you followed which tutorial to try to do something, then you met some error/not work as expected/..., you already tired something... – Tiny Wang Dec 22 '22 at 06:42

0 Answers0