title: Automapper map Generics types
body: <p>I have 2 class <strong>Data</strong> and <strong>MainData</strong> that I need to map</p>
  
  <pre><code>public class Data
  {
      public Field&lt;string&gt; Results { get; set; }
      public Field&lt;int&gt; A { get; set; }
      public Field&lt;int&gt; B { get; set; }
  }
  
  public class Field&lt;T&gt;
  {
   public string Label { get; set; }
   public T Value { get; set; }  
  }
  
  public class MainData{
   public string result {get; set; }
   public int a {get; set; }
   public int b {get; set; }
  }
  </code></pre>
  
  <p>I've tried to map <strong>Data</strong> to <strong>MainData</strong> using automapper as follows:</p>
  
  <pre><code>Mapper.CreateMap(Data, MainData))
  .ForMember(dest =&gt; dest.result, conf =&gt; conf.MapFrom(src =&gt; src.results.Value))
  .ForMember(dest =&gt; dest.a, conf =&gt; conf.MapFrom(src =&gt; src.A.Value))
  .ForMember(dest =&gt; dest.b, conf =&gt; conf.MapFrom(src =&gt; src.B.Value))
  
  var destination = Mapper.Map&lt;Data, MainData&gt;(source);
  </code></pre>
  
  <p>It's never get mapped value to <strong>desination</strong> variable. All i get is new MainData object.</p>