I have a parent child relationship, something like:
public class MyType {
public IList<MyType> Children {get;set;}
public int Order {get;set;}
}
I would like to select the list so that each level is in order.
I can do this easily for the top level:
mylist.Children.OrderBy(x => x.Order)
But how do I do it for every set of Children?
The end result would be the list or type with all its children, and there children (and so on) all sorted correctly by Order.
Thanks.
You can do Recursive Order by adding one method to
MyTypelike this: