public IActionResult BlockBySilo(int id) { try { if (!ModelState.IsValid) { return(BadRequest(ModelState)); // 400 } return(Ok(_blockService.BlockBySilo(id))); //200 } catch (Exception ex) { return(StatusCode(500, new { Result = false, ErrorMessage = ex.Message })); } }