basically you want to load a tree of comments form a datatable....something like this should work:
var allNodes= (from x in context.MyTable select x).ToList();
The above statement loads all nodes from the DB. Then, allNodes.Where(x => x.Parent == null) returns all top level tree nodes. Once you have done this all nodes will have their parent and childre propertiels already filled.
francesco ab...
All-Star
20912 Points
3279 Posts
Re: Recursive! Help!
May 30, 2012 06:16 AM|LINK
basically you want to load a tree of comments form a datatable....something like this should work:
var allNodes= (from x in context.MyTable select x).ToList();
The above statement loads all nodes from the DB. Then, allNodes.Where(x => x.Parent == null) returns all top level tree nodes. Once you have done this all nodes will have their parent and childre propertiels already filled.
Mvc Controls Toolkit | Data Moving Plug-in Videos