title: Auto-mapper class object with nested multiple class objects
body: <p>I have used auto-mapper to map single class object which is working fine, say example</p>
  
  <pre><code>class_source{
   string a;
   int b
  }
  
  class_destination
  {
   string a;
   int b
  }
  </code></pre>
  
  <p>now what I have viewModel based on multiple class object as</p>
  
  <h2>Source</h2>
  
  <pre class="lang-cs prettyprint-override"><code>public class WebSyncSummaryEntity
  {
      public Web_AppFormsEntity AppForms { get; set; }
  
      public Web_EBS_SyncEntity EBS_Sync { get; set; }
  
      public Web_SyncAuditLogEntity SyncAuditLog { get; set; }
  }
  </code></pre>
  
  <h2>Destination</h2>
  
  <pre class="lang-cs prettyprint-override"><code>[DataContract]
  public class WebSyncSummaryView
  {
      [DataMember]
      public Web_AppForms AppForms { get; set; }
  
      [DataMember]
      public Web_EBS_Sync EBS_Sync { get; set; }
  
      [DataMember]
      public Web_SyncAuditLog SyncAuditLog { get; set; }
  }
  </code></pre>
  
  <p>how I can map to equivalent class object </p>
  
  <p>I have tried in following code to map but error</p>
  
  <pre><code>public IList&lt;WebSyncSummaryView&gt; GetWebSyncSummary()
  {
      IList&lt;WebSyncSummaryView&gt; _WebSyncSummaryView = null;
  
      IList&lt;WebSyncSummaryEntity&gt; _WebSyncSummaryEntity = _WebSyncCoreObject.GetWebSyncSummary();
  
  
      if (_WebSyncSummaryEntity != null)
      {
          var config = new MapperConfiguration(cfg =&gt;
          {
              cfg.CreateMap&lt;WebSyncSummaryEntity, WebSyncSummaryView&gt;();
          });
  
          IMapper mapper = config.CreateMapper();
  
          _WebSyncSummaryView = mapper.Map&lt;IList&lt;WebSyncSummaryEntity&gt;, IList&lt;WebSyncSummaryView&gt;&gt;(_WebSyncSummaryEntity);
      }
  
      return _WebSyncSummaryView;
  }
  </code></pre>
  
  <h2>Error</h2>
  
  <pre><code> "Error mapping types.\r\n\r\nMapping types:\r\nWebSyncSummaryEntity -&gt;  WebSyncSummaryView\r\nApp.Entities.WebSyncSummaryEntity -&gt; App.WebServices.DataContract.WebSyncSummaryView\r\n\r\nType Map configuration:\r\nWebSyncSummaryEntity -&gt; WebSyncSummaryView\r\nApp.Entities.WebSyncSummaryEntity -&gt; App.WebServices.DataContract.WebSyncSummaryView\r\n\r\nProperty:\r\nSyncAuditLog"}
  </code></pre>
  
  <p>Error mapping types.</p>
  
  <pre><code>Mapping types:
  IList`1 -&gt; IList`1
  System.Collections.Generic.IList`1[[App.Entities.WebSyncSummaryEntity,  App.Entities, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]] -&gt;  System.Collections.Generic.IList`1[[App.WebServices.DataContract.WebSyncSummaryView, App.Services.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
  </code></pre>