I am trying to retrieve data from a List<T> for paging purposes. How can do this in LINQ:
private List<MyData> GetPagingData(int pageNumber)
{
if (pageNumber == 1)
return myData.Take(8);
// What to do here?
}
This works for page one. It returns the top 8 records. How do I make this work for page 2, etc…
If you want the page number to start at 0:
If you want the page number to start at 1: