I have an XML like this:
And I have a Member class with property Name.
How can I read every Unit and its children Units into multiple generic List
The challenge would be to write it as 1 LINQ query, but that's beyond me. LINQ isn't easy/suitable for recursion.
I'll sketch a solution, I'm not going to write it out :
class Unit { ... ; ... List Children; }
var units = doc.Descendants("Unit");
var Lookup = new Dictionary ();