public async Task <IActionResult> PutAsync(int id, [FromBody] SaveDispatcherResource resource) { var dispatcher = _mapper.Map <SaveDispatcherResource, Dispatcher>(resource); var result = await _dispatcherService.UpdateAsync(id, dispatcher); if (result == null) { return(BadRequest(result.Message)); } var dispatcherResource = _mapper.Map <Dispatcher, DispatcherResource>(result.Resource); return(Ok(dispatcherResource)); }