I\'m having a problem knowing the best way to make a method to group a list of items into groups of (for example) no more than 3 items. I\'ve created the method below, but w
I think you are looking for something like this:
return source.Select((x, idx) => new { x, idx }) .GroupBy(x => x.idx / itemsPerGroup) .Select(g => g.Select(a => a.x));
You need to change your return type as IEnumerable>
IEnumerable>