title: OData Linq problem
body: <p>I've created an application that exposes a self-hosted OData web service. The web service exposes a collection of objects named "Main". Each of these Main objects has a reference to a releated "Details" object, which is very large (many properties, nearly a hundred).</p>
  
  <p>I now use LinqPad to test my web service, which seems to work fine.</p>
  
  <p>Often I need information from both the "Main"-collection and the related "Details" object. This can be accomplished by running the following linq query:</p>
  
  <pre><code> from m in Main.Expand( "Details" )
   where m.ID==57
   select m
  </code></pre>
  
  <p>This correspons to the url: </p>
  
  <pre><code> "http://MachineName:port/ServiceName/Main()?$filter=ID eq 57&amp;$expand=Details"
  </code></pre>
  
  <p>This query works fine and returns the full Main object and the full related Details object.</p>
  
  <p>However, the Details object is very large, and often I only need the value of a single single property from both of the objects.</p>
  
  <p>Manually, I can construct a url that gives me exacly that:</p>
  
  <pre><code> "http://MachineName/ServiceName/Main()?filter=ID eq 57&amp;$expand=Details&amp;$select=Property1,Details/Property2"
  </code></pre>
  
  <p>which returns xml containing only the value of Main.Property1 and the value of the related Details.Property2.</p>
  
  <p>Question: Why can't I create a linq query that does just that?</p>
  
  <p>When I try something like: </p>
  
  <pre><code> from m in Main.Expand( "Details" )
   where m.ID == 57
   select new{ m.Property1, m.Details.Property2 }
  </code></pre>
  
  <p>it gives me the an error message: "NotSupportedException: Cannot create projection while there is an explicit expansion specified on the same query."</p>
  
  <p>I have now given up using Linq to construct the query. But knowing the corrct url like above, how can i use that url directly in code (C# client) and how do I then access the result?</p>