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 };