Skip to content

Instantly share code, notes, and snippets.

@walalm
Last active December 8, 2017 22:23
Show Gist options
  • Save walalm/af85075a1fe1633f02d9b905149de9d5 to your computer and use it in GitHub Desktop.
Save walalm/af85075a1fe1633f02d9b905149de9d5 to your computer and use it in GitHub Desktop.
Group Umbraco Content
var members = Umbraco.TypedContent(9999).Children("membersList")
.Where(x => x.IsVisible()).OrderBy("order");
int chunkSize = 3;
var memberGroups = members.Select((x, i) => new { Index = i, Value = x })
.GroupBy(x => x.Index / chunkSize)
.Select(x => x.Select(v => v.Value).ToList())
.ToList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment