public static ListaEstacionamentoTO ListarPorApartamento(int idApartamento) { _Crud = CrudService <EstacionamentoCrud> .ObterInstancia(); ListaEstacionamentoTO retorno = new ListaEstacionamentoTO(); try { retorno = _Crud.Listar(); if (retorno.Valido) { retorno.Lista = retorno.Lista.Where(x => x.IdApartamento == idApartamento).ToList(); } } catch (Exception ex) { retorno.Valido = false; retorno.Mensagem = string.Format("Erro: {0}", ex.Message); } return(retorno); }
public static ListaEstacionamentoTO Listar() { _Crud = CrudService <EstacionamentoCrud> .ObterInstancia(); return(_Crud.Listar()); }