Exemplo n.º 1
0
        public async Task <IEnumerable <AlunoViewModel> > ObterAlunos()
        {
            var alunos = await _alunoRepository.GetAllReadOnly(new[] { "Sala", "Responsavel" });

            foreach (var aluno in alunos)
            {
                aluno.Responsavel.Alunos = null;
                aluno.Sala.Alunos        = null;
            }

            return(Mapper.Map <IEnumerable <AlunoViewModel> >(alunos));
        }