Exploring MoreLINQ Part 7 - Batching

added by DotNetKicks
8/29/2018 9:29:18 AM

1 Kicks, 909 Views

The seventh video in my Exploring MoreLINQ series looks at the Batch extension methods, and this is another of my favourites. It simply lets you split your sequence into batches of n elements each. Although this is possible with a few built-in LINQ methods, the MoreLINQ solution is much more elegant: var batchSize = 2; // batching with built-in LINQ methods: var batches = myCollection.