public async Task <GradeResponse> GetGradeAsync(int codigoGrade) { GradeResponse gradeResponse = null; var grade = await _gradeRepository.GetGradeWithProfessorAndMatriculasAsync(codigoGrade); if (grade != null) { var matriculas = _matriculaService.GetMatriculasBySubgrades(grade.Subgrades); var alunos = await _alunoService.GetAlunosByMatriculasAsync(matriculas); gradeResponse = new GradeResponse(grade, alunos); } return(gradeResponse); }