I am attempting to split a list into a series of smaller lists.
My Problem: My function to split lists doesn\'t split them into lists of the correct
public static IEnumerable> Batch(this IEnumerable items, int maxItems) { return items.Select((item, index) => new { item, index }) .GroupBy(x => x.index / maxItems) .Select(g => g.Select(x => x.item)); }