Determine if record has children in LINQ to SQL
问题 I am having at hierarchical table with the structure ID, Name, FK_ID, Sortkey Fetching the data in LINQ to SQL is straight forward: var list = from ls in db.myTable where ls.FK_ID == levelId orderby ls.sortkey ascending select ls; And I can traverse down the tree by linking to the next levelId. But what I can't figure out, if there is a way in LINQ, to check if there is any children I could probably build a view, that added a flag to each record, but I would rather do this in LINQ, if