linq to sql recursive query

EmployeeId  Name  ManagerId
------------------------------
1           A     null
2           B     null
3           C     1
4           D     3
5           E     2

just using this table, how can a linq query (using linq to sql) be written to fetch the parent data recursively.

For instance if the Employer Id selected is 4 it should give list of employees with Id: 4, 3, 1

Thanks.

16
задан stackoverflowuser 1 November 2010 в 19:00
поделиться