Revize 7bbe8f15
Přidáno uživatelem Vojtěch Bartička před asi 3 roky(ů)
Backend/Core/Services/DocumentService/DocumentServiceEF.cs | ||
---|---|---|
119 | 119 |
pageCount = 1; |
120 | 120 |
} |
121 | 121 |
|
122 |
if (firstIndex > documents.Count - 1) |
|
123 |
{ |
|
124 |
throw new Exception("Page index or page size too large"); |
|
125 |
} |
|
126 |
|
|
127 |
if (firstIndex + request.PageSize > documents.Count - 1) |
|
128 |
{ |
|
129 |
request.PageSize = documents.Count - firstIndex; |
|
130 |
} |
|
131 |
|
|
122 | 132 |
List<DocumentListInfo> documentInfos = new List<DocumentListInfo>(); |
123 | 133 |
foreach (var document in documents.GetRange(firstIndex, request.PageSize)) |
124 | 134 |
{ |
... | ... | |
127 | 137 |
|
128 | 138 |
DocumentListInfo dai = mapper.Map<DocumentListInfo>(document); |
129 | 139 |
dai.AnnotatingUsers = annotatingUsersDto; |
130 |
documentInfos.Add(dai);
|
|
140 |
documentInfos.Add(dai); |
|
131 | 141 |
} |
132 | 142 |
|
133 | 143 |
return new DocumentListResponse() |
Také k dispozici: Unified diff
Check number of documents in DocumentService.GetDocuments