Can someone suggest a way to create batches of a certain size in linq?
Ideally I want to be able to perform operations in chunks of some configurable amount.
Another way is using Rx Buffer operator
//using System.Linq; //using System.Reactive.Linq; //using System.Reactive.Threading.Tasks; var observableBatches = anAnumerable.ToObservable().Buffer(size); var batches = aList.ToObservable().Buffer(size).ToList().ToTask().GetAwaiter().GetResult();