Follow navigation property in dynamic linq
<p>I'm trying to use dynamic linq to query data. Now I have a (normal) linq query like:</p>

<pre><code>from u in c.Users
from d in u.Documents
select d.DocumentID
</code></pre>

<p>I'm looking for the equivalent of this in dynamic linq. The emphasis is on how to navigate from the User entity to the Document entity. I can do something like:</p>

<pre><code>c.Users.Select("new (UserName)");
</code></pre>

<p>But of course i cannot do:</p>

<pre><code>c.Users.Select("new (Documents.DocumentID AS DocumentID)");
</code></pre>

<p>I thought i might be able to do something like:</p>

<pre><code>var q = c.Users.Select("Documents");
q.Select("new (DocumentID)");
</code></pre>

<p>But this doesn't work.</p>

<p>I've found tons of examples of using navigation properties in where clauses. I've been able to use them in where clauses, but not in the select.</p>

<p>I've found one example of someone doing:</p>

<pre><code>c.Users.SelectMany("Documents").Select("new (DocumentID)");
</code></pre>

<p>However, dynamic linq doesn't seem to have support for selectMany. At least there doesn't seem to be any overload to selectmany accepting a string as input when dynamic linq is included.</p>

<p>Is there anyone who can push me into the right direction? I would also welcome suggestions on how to do the selectmany without dynamic linq as well, as long as the "Documents" part and the select list (in this case "DocumentID" is dynamic and can be determined by a string input</p>