From decf25562a1c3c952c72d0cdfdc03acb1ad9cd79 Mon Sep 17 00:00:00 2001 From: he <10978375@qq.com> Date: Tue, 7 Jun 2022 09:11:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Reading/ReadModuleService.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs index a7e8616a6..305e6f0b9 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs @@ -93,9 +93,14 @@ namespace IRaCIS.Application.Services TotalCount =await subjectQuery.Select(x => x.SubjectId).Distinct().CountAsync(), }; + var maxcount = 0; + pageOutput.CurrentPageData.ForEach(x => { + maxcount = maxcount < x.Data.Count ? x.Data.Count : maxcount; + }); + return (pageOutput, new { - MaxLength = pageOutput.CurrentPageData.ToList().Max(x => x.Data.Count) + MaxLength = maxcount }); #region 用导航属性写的 有问题