From 01f214a60b4324ed881a5190030cd49dc6d9b216 Mon Sep 17 00:00:00 2001 From: "ashutosh.nehete" Date: Wed, 10 Sep 2025 10:27:24 +0530 Subject: [PATCH] Added the TotalRecords parameter to get contact list API response --- Marco.Pms.Services/Service/DirectoryService.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Marco.Pms.Services/Service/DirectoryService.cs b/Marco.Pms.Services/Service/DirectoryService.cs index d522f66..9375cad 100644 --- a/Marco.Pms.Services/Service/DirectoryService.cs +++ b/Marco.Pms.Services/Service/DirectoryService.cs @@ -231,11 +231,14 @@ namespace Marco.Pms.Services.Service return contactVM; }).ToList(); + var totalPages = (int)Math.Ceiling((double)totalCount / pageSize); + // Step 7: Construct and return the final response. var response = new { - TotalPages = (int)Math.Ceiling((double)totalCount / pageSize), + TotalPages = totalPages, CurrentPage = pageNumber, + TotalRecords = totalCount, PageSize = pageSize, Data = list };