Advertisement
Guest User

Untitled

a guest
May 19th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. public static List<List<Product>> GetPages(this List<Product> listOfProducts, int pageSize, int pageNumber)
  2.         {
  3.             List<List<Product>> allPages = new List<List<Product>>();
  4.             for (int i = 0; i<pageNumber; i++)
  5.             {
  6.                 allPages.Add(listOfProducts.Skip(pageSize * pageNumber).Take(pageSize).ToList());
  7.             }
  8.  
  9.             return allPages;
  10.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement