As others have explained, Take () and Skip () are what you need.
They will break the result set to get the page you need.
You must somehow support the PageIndex and PageSize information so that you can pass them when the query is executed. If your access to data is through a web service, for example, you must pass the index / size along with your filtering criteria, maintaining these values in your client (application or page, if this is a website).
There is no “stateful pager iterator” out of the box if that is what you are looking for ...
In addition, if you are implementing the “standard paging” design, you will need to get the total number of records before limiting your request, which you can do so assuming that your function somehow receives the PageSize and PageIndex parameters:
var query = ...your normal query here... int totalRecordCount = query.Count(); var pagedQuery = query.Skip(PageIndex*PageSize).Take(PageSize);
source share