Performing hierarchical search / sorting using the adjacency list is not easy, especially in Linq.
Instead of writing a large block of code here, I am sending you to someone else who has already done this:
Linq AsHierarchy () Extension Method
This converts the adjacency list into an actual tree structure, which is then easily displayed / searched / sorted hierarchically.
source share