public IEnumerable <FuncionarioModel> Get() { try { var listFuncionarios = FuncionarioRepository.List(); foreach (FuncionarioModel funcionario in listFuncionarios) { funcionario.LIST_CONTATO = ContatoService.GetComParametro(new ContatoQO(0, funcionario.PESSOA_ID)).ToList(); funcionario.LIST_ENDERECO = EnderecoService.GetComParametro(new EnderecoQO(0, funcionario.PESSOA_ID)).ToList(); } return(listFuncionarios); } catch (Exception) { throw; } }
public IEnumerable <PessoaModel> Get() { try { var listPessoas = PessoaRepository.List(); foreach (PessoaModel pessoa in listPessoas) { pessoa.LIST_CONTATO = ContatoService.GetComParametro(new ContatoQO(0, pessoa.PESSOA_ID)).ToList(); pessoa.LIST_ENDERECO = EnderecoService.GetComParametro(new EnderecoQO(0, pessoa.PESSOA_ID)).ToList(); } return(listPessoas); } catch (Exception) { throw; } }