public IActionResult createSignal([FromBody] SignalModel model) { var signal = _mapper.Map <Signal>(model); try { // create signal _signalService.create(signal); return(Ok()); } catch (Exception ex) { // return error message if there was an exception return(BadRequest(new { message = ex.Message })); } }