We've got a Class called Group, it contains a collection of questions and it also contains collection of groups (i.e. we have a potential nesting of groups).
Expressed in XML this might look something like this:
<group id="Group1">
<questions>
<question id="questions11"/>
</questions>
<groups>
<group id="group12">
<questions>
<question id="question121"/>
</questions>
<groups>
<group id ="group121">
<questions>
<question id="question1211"/>
</questions>
</group>
<group id ="group122">
<questions>
<question id="question1221"/>
</questions>
</group>
</groups>
</group>
<group id="group13">
<questions>
<question id="question131"/>
</questions>
</group>
</groups>
</group>
I've actually simplified the structure, for brevity I've omitted bunch of properties in each group that I'll want to include in the projection.
What I want to do is shape a new type that includes the hierachical structure here and some of the properties but excludes some others and the questions.
I'm utterly stuck on hwo to do this in linq. I had a look at SelectMany but that wasn't what I wanted.
TIA