diff --git a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs index 1eb3379ed..064deaf6b 100644 --- a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs @@ -139,7 +139,7 @@ namespace IRaCIS.Core.Application.Contracts { await VerifyIsQCConfirmedAsync(trialId); - var maxShowOrder = await _trialQcQuestionRepository.Where(x => x.TrialId == trialId).MaxAsync(x => x.ShowOrder); + var maxShowOrder = await _trialQcQuestionRepository.Where(x => x.TrialId == trialId).OrderByDescending(x=>x.ShowOrder).Select(x => x.ShowOrder).FirstOrDefaultAsync(); batchList.ForEach(x => { x.ShowOrder= maxShowOrder++;