title: Automapper mapping a list of ids to objects in many-to-many scenario
body: <p>I'm looking for the best way to handle this with Automapper</p>
  
  <p>My simplified domain model (all IDs are auto generated by the DB):</p>
  
  <pre><code>public class Product
  {
      public long Id { get; set; }
      public List&lt;OrderProduct&gt; OrderProducts { get; set; }
  }
  
  public class Order
  {
      public long Id { get; set; }
      public List&lt;OrderProduct&gt; OrderProducts { get; set; }
  }
  
  public class OrderProduct
  {
      public long Id { get; set; }
      public long ProductId { get; set; }
      public long OrderId { get; set; }
      public Product Product { get; set; }
      public Order Order { get; set; }
  }
  </code></pre>
  
  <p>My DTO object:</p>
  
  <pre><code>public class CreateOrderDTO
      {
          public long Id { get; set; }
          public List&lt;long&gt; ProductIds { get; set; }
      }
  </code></pre>
  
  <p>Now, I need to map from CreateOrderDTO to Order object. What is the best way to achieve this using automapper? I can map it using plain C# - however would really like to know the proper way to do this using Automapper.</p>