I suggest you to use Batch
operator of MoreLINQ (available from NuGet):
IEnumerable> chuncks = list.Batch(9);
If you want list of lists, then you can create own extension:
public static List> Batch(this IEnumerable source, int batchSize)
{
List> result = new List>();
List batch = new List(batchSize);
foreach(T item in source)
{
if (batch.Count == batchSize)
{
result.Add(batch);
batch = new List(batchSize);
}
batch.Add(item);
}
if (batch.Any())
result.Add(batch);
return result;
}
Your current implementation has big drawback - list.Skip(i)
will enumerate source list from beginning for each batch you are adding to result.