Microsoft.AspNetCore.Http.StatusCodes contains lots of status code constants useful for returning from a controller and can for example be used like this in a controller:
return StatusCode(StatusCodes.Status201Created);
But oddly the StatusCodes class contains no value for 422 Unprocessable Entity, at least not in Asp.Net Core 1.0.1. Why doesn't it contain StatusCodes.Status422UnprocessableEntity ?
Has this http status code been depreciated by some spec I am unaware of? Or is there some other reason that 422 Unprocessable Entity wasn't included?
Actually it is included in Microsoft.AspNetCore.Http.StatusCodes.
Please find current list in: StatusCodes.cs
HTTP Status Code 422 is WebDAV specific (RFC 4918) and it was added to Microsoft.AspNetCore.Http.StatusCodes a little bit later.
(See details of Added HTTP Status codes #654 pull request)
But it was a few months ago, so the question is what version of ASP.NET Core are you using?
Update:
As Ron C noticed - this status code is included in v1.1 (and not available in v1.0.1).
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