I'm creating a DataAnnotation that if not successful will return a BadRequest.
context.Result = new BadRequestResult();
That works fine.
I want to include a message along with this, but BadRequestResult doesn't appear to take any message params?
Is there a way to do this...include a message to say e.g. "reference number not supplied"
Thanks
This appears to work:
context.Result = new BadRequestObjectResult("Reference number not supplied.");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With