title: AutoMapper map source property into inner destination object
body: <p>I have one source class:</p>
  
  <pre><code>class Source {
      public string Name;
      public string Field1;
      public string Field2;
  }
  </code></pre>
  
  <p>and two destination classes:</p>
  
  <pre><code>class Destination {
      public string Name;
      public FieldsDto Fields;
  }
  
  class FieldsDto {
      public string Field1;
      public string FieldTwo;
  }
  </code></pre>
  
  <p>How can I map <code>Source.Field1</code> to <code>Destination.Fields.Field1</code> and <code>Source.Field2</code> to <code>Destination.Fields.FieldTwo</code>?</p>
  
  <p>This code does not work; it would throw an error saying that <code>Custom configuration for members is only supported for top-level individ
  ual members on a type1</code>:</p>
  
  <pre><code>Mapper.Initialize(cfg =&gt; {
      cfg.CreateMap&lt;Source, Destination&gt;()
          .ForMember(dest =&gt; dest.Fields.Field1, opt =&gt; opt.Mapfrom(src =&gt; src.Field1)
          .ForMember(dest =&gt; dest.Fields.FieldTwo, opt =&gt; opt.Mapfrom(src =&gt; src.Field2);
  });
  </code></pre>