public IActionResult UpdateAgent(AgentResource updatedAgent) { try { var _agent_to_update = mapper.Map <Agent>(updatedAgent); serviceAgent.UpdateAgent(_agent_to_update); return(Ok(_agent_to_update)); } catch (Exception ex) { return(BadRequest(ex.Message)); } }