Esempio n. 1
0
        private async Task <int> GetTotalCountStudentByTeacherIdAsync(int id)
        {
            int countResult    = 0;
            var listCurriculum = _curriculumRepository.GetAllAsync(0, 1, (m => m.PeopleId == id)).Result.Item1.ToList();

            foreach (var curriculum in listCurriculum)
            {
                countResult += _schoolEnrollmentRepository.GetAllAsync(0, 1, (m => m.CurriculumId == curriculum.Id))
                               .Result.Item1.Count();
            }

            return(countResult);
        }
Esempio n. 2
0
 private async Task <Curriculum> GetCurriculumByCodeAsync(int code)
 {
     return(_curriculumRepository.GetAllAsync(0, 1, (m => m.Code == code)).Result.Item1.SingleOrDefault().MapToEntity());
 }