title: Order by with Linq + Include
body: <p>I have a One-Many relation with two Entities :</p>
  
  <pre><code>Order:
  int OrderId 
  string OrderNumber
  ...
  
  OrderItem:
  int ItemId
  int sequence
  ...
  
  Product:
  int ProductId
  string ProductName
  
  ProductType:
  int ProductTypeid
  string Title
  </code></pre>
  
  <p>One <code>Order</code> Has multiple <code>OrderItems</code>, and each <code>OrderItem</code> has One <code>Product</code> and each <code>Product</code> has one <code>ProductType</code>.</p>
  
  <p>I want to write a Linq that return all orders with their <code>items</code>,<code>Product</code>,<code>ProductType</code> and items be sorted by sequence field. How can I write a query such as following query?</p>
  
  <p>with help from <a href="https://stackoverflow.com/questions/14474320/order-by-with-linq">Order by with Linq</a> i wrote this query:</p>
  
  <pre><code>var myOrder= db.Orders.Include("OrderItems")
           .Where(x =&gt; x.OrderId == 3)
           .Include("OrderItems.Product") 
           .Include("OrderItems.Product.ProductType") 
           .Select(o =&gt; new {
               order = o,
               orderItems = o.OrderItems.OrderBy(i =&gt; i.sequence)
           }).FirstOrDefault();
  </code></pre>
  
  <p>but when it return the result, <strong>it doesn't contain Product and ProductType data</strong>.
  where is my mistake? </p>