gmo61520

Untitled

Mar 18th, 2016
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. var orderedModel = unorderedModel
  2. .SelectManyRecursive(x => x.Children.Select(y => {
  3. if (x.RootSortOrder == null) x.RootSortOrder = x.SortOrder;
  4. y.RootSortOrder = x.RootSortOrder;
  5. return y;
  6. }))
  7. .OrderBy(x => x.RootSortOrder)
  8. .ThenBy(y => y.Parent == null ? null : y.Parent.Title)
  9. .ThenBy(y => y.Title)
  10. .ToList();
Advertisement
Add Comment
Please, Sign In to add comment