title: AutoMapper: map DTO back to domain object with child objects
body: <p>Let's say I have two objects I'd like to map:</p>
  
  <pre><code>// Domain objects
  public class MyDomainObject
  {
      public string SimpleText { get; set; }
      public int SimpleNumber { get; set; }
      public MySubObject ComplexValue { get; set; }
  }
  
  public class MySubObject
  {
      public int Id { get; set; }
      public string Name { get; set; }
  }
  
  // DTOs
  public class MyDto
  {
      public string SimpleText { get; set; }
      public int SimpleNumber { get; set; }
      public int ComplexValueId { get; set; }
      public string ComplexValueName { get; set; }
  }
  
  // Mapping config
  Mapper.CreateMap&lt;MyDomainObject, MyDto&gt;();
  </code></pre>
  
  <p>Ths will work fine without extra configuration because AutoMapper will look at <strong>camelcasing</strong> and drill down.</p>
  
  <p>Now I'd like to <strong>map the DTO back to the domain object</strong>:<br />
  <code>Mapper.Map&lt;MyDto, MyDomainObject&gt;(dto, domainObj);</code></p>
  
  <p>What would the best/simplest mapping <strong>configuration</strong> be to achieve it?</p>