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