3
我需要递归地获得所有后代的某些节点。例如,对于Id = 1的节点,我需要获得以下后代:2,3,4,5,6。对于Id = 2的节点,我需要获取节点:4,5,7。我如何才能做到这一点赢得Linq-Ent-Entites服务器的最低要求?如何获得某个节点的所有后代whisq-To-Entites?
| Id | ParentId | Name |
------------------------
| 1 | 1 | a |
------------------------
| 2 | 1 | b |
------------------------
| 3 | 1 | c |
------------------------
| 4 | 2 | d |
------------------------
| 5 | 2 | e |
------------------------
| 6 | 3 | f |
------------------------
| 7 | 5 | g |
http://stackoverflow.com/questions/43111/linq-to-sql-for-self-referencing-tables –