Batching with LINQ
static IEnumerable<IEnumerable<T>> Batch<T>(this IEnumerable<T> source, int batchSize)
{
return source.Select((item, inx) => new { item, inx })
.GroupBy(x => x.inx / batchSize)
.Select(g => g.Select(x => x.item));
}
https://stackoverflow.com/questions/13731796/create-batches-in-linq
No comments to display
No comments to display