How can I do a multi level parent-child sort using Linq?
- by Tenacious T
How can I do a multi-level parent-child sort using Linq if I have a table structure like the one below:
[Table: Sections]
Id Seq Name ParentSectionId
1 1 TOP NULL
2 1 AAAA 1
3 2 SSSS 1
4 3 DDDD 1
5 1 SectionA1 2
6 2 SectionA2 2
7 1 SectionS1 3
8 3 ASummary 2
Expected sort result:
TOP
AAAA
SectionA1
SectionA2
ASummary
SSSS
SectionS1
DDDD