title: Mapping multiple child properties
body: <p>Having some Automapper headaches.  Any help appreciated!</p>
  
  <pre><code>public class ObjectA {
    public int Id { get; set; }
    public string Name { get; set; }
    public List&lt;ObjectB&gt; ObjectBList {get; set;}
  }
  
  public class ObjectB {
    public int Id { get; set; }
    public int ObjectAId { get; set; }
    public ObjectA Parent;
  
    public int ObjectCId { get; set; }
    public ObjectC SecondaryNavProperty {get; set;}
  }
  
  public ObjectADto {
    public string Name { get; set; }
    public int[] Children { get; set; }
  }
  </code></pre>
  
  <p>How do I convert the DTO to a valid ObjectA, where ObjectBList is an array of ObjectB where each entry has Id set to one of the ObjectDto.Children properties.</p>
  
  <p>I'm currently doing this: </p>
  
  <pre><code>configuration.CreateMap&lt;ObjectADto , ObjectA &gt;()
                  .ForMember(destination =&gt; ObjectA.ObjectBList , options =&gt; options.MapFrom(source =&gt; source.Children.Select(detail =&gt; detail)))
  </code></pre>
  
  <p>but this isn't right because no where am I assing <code>ObjectB.Id</code> to the item in the <code>Children</code> array.  <code>ObjectB</code> exists as a .net core many-to-many table.</p>
  
  <p>Thanks in advance!</p>