Exemplo n.º 1
0
        public IEnumerable <AlunoNotasDTO> BuscarAlunosENotasDeTurma(int turmaId)
        {
            var alunosNotas = new List <AlunoNotasDTO>();
            var alunos      = alunoRepository.BuscarAlunosENotasDeTurma(turmaId).ToList();

            alunos.ForEach(x =>
            {
                var turmaAluno = x.TurmasAluno.First(x => x.TurmaId == turmaId);
                var alN        = new AlunoNotasDTO();
                alN.AlunoId    = x.Id;
                alN.NomeAluno  = x.Nome;
                alN.Matricula  = turmaAluno.Matricula;
                alN.Notas      = x.NotasAluno.Where(x => x.Disciplina.CursoId == turmaAluno.Turma.CursoId).Select(y => new NotaAlunoDTO(y));
                alunosNotas.Add(alN);
            });
            return(alunosNotas);
        }