如果我有以下表结构,如何使用Linq进行多级父子排序?
预期的排序结果:
[表: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
TOP AAAA SectionA1 SectionA2 ASummary SSSS SectionS1 DDDD
预期的排序结果:
[表: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
TOP AAAA SectionA1 SectionA2 ASummary SSSS SectionS1 DDDD