Exemplo n.º 1
0
        public static async Task <IEnumerable <IReadOnlyList <TSource> > > Batch <TSource>(this Task <IEnumerable <TSource> > source, int batchSize)
        {
            var input = await source;

            return(IteratorEnumerable.Create(() => new BatchIterator <TSource>(input.GetEnumerator(), batchSize)));
        }
Exemplo n.º 2
0
 public static IEnumerable <IReadOnlyList <TSource> > Batch <TSource>(this IEnumerable <TSource> source, int batchSize)
 => IteratorEnumerable.Create(() => new BatchIterator <TSource>(source.GetEnumerator(), batchSize));