Esempio n. 1
0
        public async Task <ActionResult <List <YearClassDto> > > GetYearClassesAsync([FromQuery] int academicYear, [FromQuery] Guid collegeId)
        {
            var data = await _yearClassRepository.ListAsync(o => o.AcademicYear == academicYear && o.CollegeId == collegeId);

            return(data.Select(o => YearClassDto.From(o)).OrderBy(o => o.YearClassName).ToList());
        }
Esempio n. 2
0
        public async Task <ActionResult <YearClassDto> > GetYearClassAsync([FromQuery] Guid yearClassId)
        {
            var data = await _yearClassRepository.GetByIdAsync(yearClassId);

            return(YearClassDto.From(data));
        }