You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
WF-PmAPI/WF_EF_Api/Shared/PaginationResult.cs

34 lines
1.3 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// Represents a paginated result set for a collection of items.
public class PaginationResult<T>
{
// Total number in the item List.
public int totalCount { get; set; }
// The current page index (starting from 0).
public int pageIndex { get; set; }
// The number of items displayed per page.
public int countPerPage { get; set; }
// The list of items for the current page.
public List<T> items { get; set; }
// Constructor to initialize a new instance of the PaginationResult class.
// 'totalCount' is the total number of items, 'pageIndex' is the current page,
// 'countPerPage' is the number of items per page, and 'items' is the list of items for the current page.
public PaginationResult(int totalCount, int pageIndex, int countPerPage, List<T> items)
{
this.totalCount = totalCount; // Sets the total number of items available.
this.pageIndex = pageIndex; // Sets the current page index (starting from 1).
this.countPerPage = countPerPage; // Sets the number of items per page.
this.items = items; // Sets the items for the current page.
}
}