In C#, if I have a CollectionBase of type T, and each item in the CollectionBase can have a child CollectionBase of the same type T, how can I get a list of all type T objects without using a recursive function?
Does LINQ have a feature to do this?
Thanks in advance.
Wes Dyer wrote actually a nice topic on this, have a look.
As for your case I think you would need an iterator, probably something like this:
This is answer is taken from here.
EDIT: I just remember that you can also traverse the tree.