This commit is contained in:
2022-10-13 15:29:00 +08:00
parent 232b6017e1
commit 988ac22ef6
3 changed files with 17 additions and 12 deletions
@@ -165,7 +165,10 @@ namespace IRaCIS.Core.Application.Service
UserCode = user.UserCode,
UserName = user.UserName,
UserTypeEnum = user.UserTypeRole.UserTypeEnum,
ReadingCategoryList = allocationRule.Enroll.EnrollReadingCategoryList.Select(t => t.ReadingCategory).ToList()
ReadingCategoryList = allocationRule.Enroll.EnrollReadingCategoryList.AsQueryable()
.WhereIf(selectQuery.ReadingCategory != null,t=> t.ReadingCategory == selectQuery.ReadingCategory)
.WhereIf(selectQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == selectQuery.TrialReadingCriterionId)
.Select(t => t.ReadingCategory).OrderBy(t=>t).ToList()
};
return await query.ToListAsync();