Пример #1
0
        public async Task <IActionResult> Post([FromBody] ToolType toolType)
        {
            try {
                if (ModelState.IsValid)
                {
                    toolType.toolTypeId = 0;

                    toolType = await _toolTypeService.addToolType(toolType);

                    return(Created($"api/Extract/{toolType.toolTypeId}", toolType));
                }
                return(BadRequest(ModelState));
            } catch (Exception ex) {
                return(StatusCode(500, ex.Message));
            }
        }