Hello Everybody,
I have a database table where all the records are linked among each other i.e. something similar to the image bellow:
As you can see on the diagram, a record can be root and can have 1 or more children, where each child stores in its ParentID property the ID property of its parent. I was wondering if someone can help me with constructing a LINQ expression that returns all the nodes starting with the last child and finishing with the root. What I mean is the following. Starting from Node 4 (ID = 4) I have to move up to Node 2 (ID = 2), then Node 1 and then Node 0, thus skipping Node 3. I hope I am clear enough, but if something needs clarifying let me know.