SHARE
TWEET

Untitled

a guest May 19th, 2017 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         }
RAW Paste Data
Want to get better at C#?
Learn to code C# in 2017
Pastebin PRO Summer Special!
Get 40% OFF on Pastebin PRO accounts!
Top