Dapper selecting nested objects
<p>My SQL looks like</p>

<pre><code>Select TOP 3 o.OrderId,
o.Total,
od.Quantity,
od.ItemDescription,
os.OrderStatusDescription,
os.OrderStatusID
 From dbo.Orders o
 INNER JOIN dbo.OrderStatuses os ON os.OrderStatusID = o.OrderStatusID
 INNER JOIN dbo.OrderDetails od ON od.OrderID = o.OrderID
  Where o.CustomerId = 100 order by OrderDate desc;
</code></pre>

<p>I have my class on c# side as below, i have three tables on db side as well. 
i am trying to see if i can use dapper to map 3 tables into one object Order withouty having to do multiple select querys. 
i need top 3 rows from Order Table and its child tables loaded. OrderDetail can have n rows for 1 orderId.</p>

<p><strong>How can i selected nested object with 1 look up using dapper?</strong></p>

<pre><code> class Order{
      int OrderId {get;set;}      
      decimal Total {get;set;}
      List&lt;OrderDetail&gt; Details {get;set;}
      OrderStatus Status {get;set;}
 }

  class OrderDetail
  {
    int OrderLineId {get;set;}
    int OrderId {get;set;}  
    string ItemDescription {get;set;}
    int Quantity {get;set;}
  }

  class OrderStatus
  {
    int OrderStatusID {get;set;}
    string OrderStatusDescription {get;set;}
  }
</code></pre>

<p><strong>this is what i have tried so far but not successful</strong></p>

<pre><code>  sqlConnection.Open();

IEnumerable orders = sqlConnection
    .Query&lt;Order&gt;(
        @"select Order.*, OrderDetail.* 
          from Order join OrderDetail 
               inner join on Order.OrderId = OrderDetail.OrderId
               inner join on Order.OrderStatusID = OrderStatus.OrderId
               and Order.CustomerId = 100",
        (o, od, os) =&gt;
            {
                o.Details = od;  //this is a List&lt;OrderDetail&gt;
                o.Status = os;
                return o;
            }); // 
</code></pre>

<p><a href="https://i.stack.imgur.com/HzCUR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HzCUR.png" alt="enter image description here"></a></p>