public IHttpActionResult Update(int id, [FromBody] PacienteCommand pacienteAlteracao) { try { var paciente = _pacienteService.GetById(id); if (paciente == null) { return(NotFound()); } Paciente.Alterar(paciente, pacienteAlteracao); _pacienteService.Update(paciente); return(Ok(paciente)); } catch (Exception e) { throw new Exception("Erro ao alterar :" + e.Message); } }