Added the TotalRecords parameter to get contact list API response

This commit is contained in:
ashutosh.nehete 2025-09-10 10:27:24 +05:30
parent 935f5345b9
commit 01f214a60b

View File

@ -231,11 +231,14 @@ namespace Marco.Pms.Services.Service
return contactVM; return contactVM;
}).ToList(); }).ToList();
var totalPages = (int)Math.Ceiling((double)totalCount / pageSize);
// Step 7: Construct and return the final response. // Step 7: Construct and return the final response.
var response = new var response = new
{ {
TotalPages = (int)Math.Ceiling((double)totalCount / pageSize), TotalPages = totalPages,
CurrentPage = pageNumber, CurrentPage = pageNumber,
TotalRecords = totalCount,
PageSize = pageSize, PageSize = pageSize,
Data = list Data = list
}; };