public async Task <IActionResult> Put(int id, [FromBody] ToolType toolType) { try { if (ModelState.IsValid) { var toolTypeDb = await _toolTypeService.updateToolType(id, toolType); if (toolTypeDb == null) { return(NotFound()); } return(Ok(toolTypeDb)); } return(BadRequest(ModelState)); } catch (Exception ex) { return(StatusCode(500, ex.Message)); } }