Ejemplo n.º 1
0
        public IQueryable <Turma> ObterTurmas(int idOferta, int idUf = 0)
        {
            using (var bmO = new BMTurma())
            {
                var retorno = bmO.ObterTodos();

                if (idOferta != 0)
                {
                    retorno = retorno.Where(x => x.Oferta.ID == idOferta);
                }

                if (idUf > 0)
                {
                    retorno =
                        retorno.Where(
                            x =>
                            x.Oferta.ListaPermissao.All(c => c.Uf == null) ||
                            x.Oferta.ListaPermissao.Any(c => c.Uf != null && c.Uf.ID == idUf));
                }

                return(retorno);
            }
        }
Ejemplo n.º 2
0
 public IQueryable <Turma> ObterTodasTurma()
 {
     return(bmTurma.ObterTodos());
 }