public static class CustomExtensions
{
public static IEnumerable<List<T>> Chunk<T>(this IEnumerable<T> list, int length)
{
return list.Select((value, index) => new { index, value })
.GroupBy(item => item.index / length)
.Select(items => items.Select(item => item.value).ToList());
}
}