You can return the http status code along with the response object using:
return Ok(responseObject);
return BadRequest(responseObject);
return NotFound(responseObject);
But what about you want your own http status code back? 402, 429, 500, 501, etc.
source
to share