namespace MyNewProjectName.Contracts.Common { // PagedList model to support pagination in API responses public class PagedList { // Items in the current page public List Items { get; set; } = new List(); // Total count of items across all pages public int TotalCount { get; set; } // Current page number public int PageNumber { get; set; } // Page size (items per page) public int PageSize { get; set; } // Total number of pages public int TotalPages => (int)Math.Ceiling(TotalCount / (double)PageSize); // Flag indicating if there is a previous page public bool HasPreviousPage => PageNumber > 1; // Flag indicating if there is a next page public bool HasNextPage => PageNumber < TotalPages; public PagedList(List items, int totalCount, int pageNumber, int pageSize) { Items = items; TotalCount = totalCount; PageNumber = pageNumber; PageSize = pageSize; } // Default constructor public PagedList() { } } }