且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

LINQ to SQL自引用表?

更新时间:2021-12-04 23:16:14

我不认为linq-to-sql有一个很好的答案这个问题。因为你使用sql server 2005,你可以使用CTE来做层次查询。存储过程或内联查询(使用DataContext.ExecuteQuery)将会做到这一点。

I don't think linq-to-sql has a good answer to this problem. Since you are using sql server 2005 you can use CTEs to do hierarchical queries. Either a stored procedure or an inline query (using DataContext.ExecuteQuery) will do the trick.