Fill a Recursive Data Structure from a Self-Referential Database Table

前端 未结 1 785
忘掉有多难
忘掉有多难 2021-01-14 07:10

This question refers to http://www.matthidinger.com/archive/2009/02/08/asp.net-mvc-recursive-treeview-helper.aspx

Let\'s say I have a table that looks like this:

1条回答
  •  攒了一身酷
    2021-01-14 07:50

    I think your best option is to query the hierachy in SQL using CTEs. LINQ2SQL and hierachical/relational data don't mix too nicely. See Hierarchical data in Linq - options and performance.

    0 讨论(0)
提交回复
热议问题