Hello guys,
I have a generic list.
Some elements of this list belong to a parent element. I retrieved all these elements from a database and i want to recursively build a tree with them.
So, here's what i'm thinking:
Here is my predicate:
public static bool FindChildren(Int32 parentId,CategoryMapping catMapping)
{
if (catMapping.parentId == parentId)
{
return true;
}
else
{
return false;
}
}
root = list[0];
root.childrenElements = root.FindAll(FindChildren(root.id,???)
I can't figure out how this would work. How can i do this kind of predicate?
PS: I'm using VS2005 :(