public static ListaVisitanteTO ListarPorMorador(int idMorador) { _Crud = CrudService <VisitanteCrud> .ObterInstancia(); ListaVisitanteTO retorno = new ListaVisitanteTO(); try { retorno = _Crud.Listar(); if (retorno.Valido) { retorno.Lista = retorno.Lista.Where(x => x.IdMorador == idMorador).ToList(); } } catch (Exception ex) { retorno.Valido = false; retorno.Mensagem = string.Format("Erro: {0}", ex.Message); } return(retorno); }
public static ListaVisitanteTO Listar() { _Crud = CrudService <VisitanteCrud> .ObterInstancia(); return(_Crud.Listar()); }