title: Map lists of nested objects with Dapper
body: <p>I'm using Dapper and I have classes like this:</p>
  
  <pre><code>public class Article{
     public int Id { get; set; }
     public string Description{get;set;}
     public Group Group { get; set; }
     public List&lt;Barcode&gt; Barcode {get;set;}
     ...
  }
  
  public class Group{
     public int Id { get; set; }
     public string Description {get;set;}
  }
  
  public class Barcode{
     public int Id { get; set; }
     public string Code{get;set;}
     public int IdArticle { get; set; }
     ...
  }
  </code></pre>
  
  <p>I can get all information about Article but I would like to know if is possible with one query get also the list of barcodes for each article. Actually what I do is this: </p>
  
  <pre><code>string query = "SELECT * FROM Article a " +
  "LEFT JOIN Groups g ON a.IdGroup = g.Id ";
  
  arts = connection.Query&lt;Article, Group, Article&gt;(query,
      (art, gr) =&gt;
      { art.Group = gr;  return art; }
      , null, transaction).AsList();
  </code></pre>
  
  <p>I also found a good explanation <a href="https://stackoverflow.com/a/17748734/2204958">here</a> but I don't understand how to use it in my case, because I have also the Group class. 
  How should I do this with Dapper, is it possible or the only way is to do different steps?
  Thanks </p>