diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs index 02081e74b..b0de77951 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs @@ -224,7 +224,7 @@ namespace IRaCIS.Core.Application.Service .ProjectTo(_mapper.ConfigurationProvider); - var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize,new string[] { "SubjectId asc" } ); + var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize,new string[] { } ); return ResponseOutput.Ok(pageList, new { diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs index ee6aa1189..ef697e09b 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/IQueryablePageListExtensions.cs @@ -201,9 +201,13 @@ namespace IRaCIS.Core.Infrastructure.Extention return new PageOutput() { CurrentPageData = new T[0] }; } - var sortString = string.Join(',', sortArray); + if(sortArray.Count()>0) + { + var sortString = string.Join(',', sortArray); - source = source.OrderBy(sortString); + source = source.OrderBy(sortString); + } + source = source.Skip((pageNumber - 1) * pageSize); var items = await source