title: How can I load second degree entity relations with a WCF data service?
body: <p>I am trying to query a single entity in a database with a DataServiceQuery. 
  The entity I am trying to load has relations to a graph of other entities that I want to load as well. MSDN describes <a href="http://msdn.microsoft.com/en-us/library/ee358709.aspx" rel="nofollow">here</a> and <a href="http://msdn.microsoft.com/en-us/library/dd756366.aspx" rel="nofollow">here</a> that I can load my referred entities using either DataServiceQuery&lt;TElement&gt;.Expand or DataServiceContext.LoadProperty.</p>
  
  <p>This works fine for first degree relations of my entity, but I have a problem loading relations of relations.</p>
  
  <p>Obviously I could call LoadProperty for all second degree relations and loop through all second degree collections, but I was hoping that I could eager load the whole relation graph in a single query. Is that possible?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Actually loading the second degree relations is not that obvious after all.
  The following code fails (domain model changed for clarity):</p>
  
  <pre><code>            var context = DataServiceReference.DataServiceContextFactory.Create();
              var customer = (from c in context.Customers.Expand("Orders")
                                  where c.CustomerId.Equals(customerId)
                                   select c).First();
              foreach (var order in customer.Orders)
              {
                  context.LoadProperty(order, "Products");
  </code></pre>
  
  <p>The last line above throws InvalidOperationException: "The context is not currently tracking the entity.".
  I use self-tracking-entities. Could this error be related to STE?</p>
  
  <p>How would I load second degree relations in any way?</p>
  
  <p><strong>Solution edit</strong></p>
  
  <p>It turns out that DataServiceQuery&lt;TElement&gt;.Expand uses a different path syntax compared to ObjectQuery&lt;T&gt;.Include. The former uses slash as path separator the latter uses dot. Can anyone explain why the syntax is inconsistent and where I can find documentation of the Expand path syntax?</p>