我在DB with TreeNodes表中有一个树形结构。该表包含nodeId、parentId和parameterId。在EF中,结构类似于TreeNode.Children,其中每个子对象都是一个TreeNode...我还有一个包含id、name和rootNodeId的树表。
在一天结束的时候,我想把树加载到TreeView中,但是我不知道如何一次加载所有的树。我试过了:
var trees = from t in context.TreeSet.Include("Root").Include("Root.Children").Include("Root.Children.Parameter")
.Include("Root.Children.Children")
where t.ID == id
select t;
这会让我得到前两代,但不会更多。如何加载包含所有代和附加数据的整个树?
https://stackoverflow.com/questions/2266473
复制相似问题