I’m looking for a examples on how to best iterate over a table with two cols; Parent and Child
Given a Parent, if a child is found I want to add it to a new List. Then I want to query again this time using the previous Child but now as the Parent to check if this child has children…and so on…
I hope this makes sense. Thanks in advance for your help.
I’m writing the queries in Linq against Entities.
I believe you are looking for a way to recursively get the data from a self referencing table. Here is an article explaining Parent – Child in recursive data table with LINQ
From Article