From efc577f9a25286c0b98d4f65a4a168ef75820191 Mon Sep 17 00:00:00 2001 From: "ashutosh.nehete" Date: Wed, 3 Sep 2025 11:06:22 +0530 Subject: [PATCH] Corrected the equation to gt total number of pages --- Marco.Pms.Services/Controllers/DocumentController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marco.Pms.Services/Controllers/DocumentController.cs b/Marco.Pms.Services/Controllers/DocumentController.cs index 909ce53..744569d 100644 --- a/Marco.Pms.Services/Controllers/DocumentController.cs +++ b/Marco.Pms.Services/Controllers/DocumentController.cs @@ -187,7 +187,7 @@ namespace Marco.Pms.Services.Controllers } var totalCount = await documentQuery.CountAsync(); - var totalPages = totalCount / pageSize; + var totalPages = (int)Math.Ceiling((double)totalCount / pageSize); ; // Apply pagination & ordering var documents = await documentQuery @@ -424,7 +424,7 @@ namespace Marco.Pms.Services.Controllers .Where(av => av.ParentAttachmentId == parentAttachmentId && av.TenantId == tenantId); var totalCount = await versionMappingsQuery.CountAsync(); - var totalPages = totalCount / pageSize; + var totalPages = (int)Math.Ceiling((double)totalCount / pageSize); ; var versionMappings = await versionMappingsQuery .OrderByDescending(da => da.ChildAttachment!.UploadedAt)