The Microsoft.AspNetCore.Mvc.Controller base class doesn't have an equivalent of BadRequest(), Ok(), NoContent(), etc. for returning HTTP 500 status codes.
Why can't we do?
try{
oops();
}
catch(Exception ex){
//some handling
return InternalServerError(ex);
}
I know can do return StatusCode(500);, but we are trying to be more consistent with our HTTP codes and would like to know if there is something more consistent with Ok() for returning a 500 code?
Response.StatusCode = 500;