title: Project from entity with child collection to flatened collection of dtos
body: <p>I have a collection of Foo objects that each have a collection of Bars.</p>
  
  <p>What I want is to project my collection of Foo's to FooDTO's which will be a flattened version, one per child. How can I do that?</p>
  
  <p>e.g. : </p>
  
  <pre><code>public class Foo
  {
      public int Id { get; set; }
      public List&lt;Bar&gt; Bar { get; set; }
  }
  
  public class Bar
  {
      public string Name;
  }
  
  public class FooDto
  {
      public int Id { get; set; }
      public string BarName { get; set; }
  }
  </code></pre>
  
  <p>so If I have </p>
  
  <pre><code>        var foos = new List&lt;Foo&gt;
          {
              new Foo
              {
                  Id = 1,
                  Bar = new List&lt;Bar&gt;
                  {
                      new Bar {Name = "foobar"},
                      new Bar {Name = "barfoo"}
                  }
              },
              new Foo
              {
                  Id = 2,
                  Bar = new List&lt;Bar&gt;
                  {
                      new Bar {Name = "2foobar"},
                      new Bar {Name = "2barfoo"}
                  }
              }
          };
  
  var collection = Mapper.Some_kind_of_Magic(foos);
  </code></pre>
  
  <p>collection would be look like : </p>
  
  <pre><code>[ 
      new FooDto{ Id = 1, BarName = "foobar"}, 
      new FooDto{ Id = 1, BarName = "barfoo" } 
      new FooDto{ Id = 2, BarName = "2foobar"}, 
      new FooDto{ Id = 2, BarName = "2barfoo" } 
  ]
  </code></pre>
  
  <p>How can I do it? Is it possible with a map?</p>