I am wanting to loop through this list of name value pairs and grab them in groups of 4.
The data would be like:
value1 1 value2 1 value3 1 value4 1
There's nothing built into the framework to do this easily, but MoreLINQ has the Batch method:
IEnumerable> groups = source.Batch(4); foreach (IEnumerable group in groups) { foreach (DataItem item in group) { ... } }