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()); }
public async Task <ActionResult <YearClassDto> > GetYearClassAsync([FromQuery] Guid yearClassId) { var data = await _yearClassRepository.GetByIdAsync(yearClassId); return(YearClassDto.From(data)); }