Inside Mendz.Data.PagingInfo

Mendz.Data.PagingInfo represents paging information. The idea is to basically have a POCO that can be used to store and exchange paging data that can be used by backend queries, by middlewares and by frontend rendering codes.

A typical website can have a grid listing a set of data. If there are more data that can fit in a page, the grid can provide a pagination control that would let the user navigate through the pages.

PagingInfo provides a way to store and exchange paging information so that (1) pagination can be achieved; and (2) the pagination control can be rendered in the UI.

The main properties are Page (the current page) and PageSize (the number of rows to show per page). Additional properties are provided that can support different paging approaches and strategies, such as those that use offset values, for example. TotalRows and PageCount can be used to render smart pagination controls that can present the total rows or the total number of pages available to the user.

PagingInfo is used in Mendz.Data.Repository.IDbDataSearchable and Mendz.Data.Repository.Async.IDbDataSearchableAsync interfaces. Use them in repositories that populate grids and lists with pagination support to navigate through the data. Get Mendz.Data and start building fantastic applications that can handle large data sources.

Comments