public static IList> SplitList(this IList list, int chunkSize)
{
var chunks = new List>();
List chunk = null;
for (var i = 0; i < list.Count; i++)
{
if (i % chunkSize == 0)
{
chunk = new List(chunkSize);
chunks.Add(chunk);
}
chunk.Add(list[i]);
}
return chunks;
}