This method checks the Status and based on that returns a 200 or 400 status code.
private IActionResult ResponseType(Response response)
{
if (response.Status)
return Ok(response);
return BadRequest(response);
}
I want to call this method from all controllers, so I can determine if I should return a 200 or 400. Where should I declare this method? In a "common" controller, service etc? What is the best practice for this use case?