title: Join vs Navigation property for sub lists in Entity Framework
body: <p>I have a sql statement like this:</p>
  
  <pre><code>DECLARE @destinations table(destinationId int)
  INSERT INTO @destinations
  VALUES (414),(416)
  
  SELECT *
  FROM GroupOrder grp (NOLOCK)
            JOIN DestinationGroupItem destItem (NOLOCK)
                      ON destItem.GroupOrderId = grp.GroupOrderId
            JOIN @destinations dests
                      ON destItem.DestinationId = dests.destinationId
  WHERE OrderId = 5662
  </code></pre>
  
  <p>I am using entity framework and I am having a hard time getting this query into Linq.  (The only reason I wrote the query above was to help me conceptualize what I was looking for.)</p>
  
  <p>I have an IQueryable of GroupOrder entities and a List of integers that are my destinations.</p>
  
  <p>After looking at this I realize that I can probably just do two joins (like my SQL query) and get to what I want.</p>
  
  <p>But it seems a bit odd to do that because a GroupOrder object already has a list of DestinationGroupItem objects on it.</p>
  
  <p>I am a bit confused how to use the Navigation property on the GroupOrder when I have an IQueryable listing of GroupOrders.</p>
  
  <p>Also, if possible, I would like to do this in one trip to the database.  (I think I could do a few <code>foreach</code> loops to get this done, but it would not be as efficient as a single IQueryable run to the database.)</p>
  
  <p>NOTE: I prefer fluent linq syntax over the query linq syntax.  But beggars can't be choosers so I will take whatever I can get.</p>