diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index 92893e0ca..e0b091502 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -1766,7 +1766,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto [NotDefault] public Guid QuestionId { get; set; } - public string Type { get; set; } + public string Type { get; set; } = string.Empty; + + public List TypeList { get; set; } = new List(); } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs index 78a91e998..fa89dc852 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs @@ -150,7 +150,10 @@ namespace IRaCIS.Core.Application.Service var result = await _readingTableQuestionTrialRepository .Where(x => x.ReadingQuestionId == inDto.QuestionId) - .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) + .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) + .WhereIf(inDto.TypeList.Count() > 0, x => inDto.TypeList.Contains(x.Type)) + + .OrderBy(x => x.ShowOrder) .ProjectTo(_mapper.ConfigurationProvider, new { @@ -172,7 +175,8 @@ namespace IRaCIS.Core.Application.Service var result = await _readingTableQuestionSystemRepository .Where(x => x.ReadingQuestionId == inDto.QuestionId) - .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) + .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) + .WhereIf(inDto.TypeList.Count() > 0, x => inDto.TypeList.Contains(x.Type)) .OrderBy(x => x.ShowOrder) .ProjectTo(_mapper.ConfigurationProvider, new {