title: Convert Dictionary<int, string> to strongly typed class ICollection Using AutoMapper
body: <p>I working on .NET CORE 6 application. I have <code>Dictionary&lt;int, string&gt;</code> that I need to convert to an ICollection of class object. I have create separate profile class; refer below. However I am getting error.</p>
  <pre><code>Error mapping types.
  
  Mapping types:
  List`1 -&gt; ICollection`1
  
  System.Collections.Generic.List`1[[System.Collections.Generic.Dictionary`2[[System.Int32, 
  System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, 
  PublicKeyToken=7cec85d7bea7798e],[System.String, System.Private.CoreLib, 
  Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], 
  System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, 
  PublicKeyToken=7cec85d7bea7798e]]
  </code></pre>
  <p><code>Entity Class</code></p>
  <pre><code> public class AIMSchema
  {
      public DateTime TransactionDate { get; set; }
      public string MachineCode { get; set; }
  }
  </code></pre>
  <p><code>AutoMapper profile</code></p>
  <pre><code>public class AIMConfigProfile : Profile
  {
      public AIMConfigProfile()
      {
          CreateMap&lt;Dictionary&lt;int, string&gt;, AIMSchema&gt;()
              .ForMember(dest =&gt; dest.TransactionDate, opt =&gt; opt.MapFrom(source =&gt; source.ContainsKey(1)))
              .ForMember(dest =&gt; dest.MachineCode, opt =&gt; opt.MapFrom(source =&gt; source.ContainsKey(2)))
              ;
      }
  }
  </code></pre>
  <p>Calling from class to covert dictionary data...</p>
  <pre><code>var ff = _ambientState.Mapper.Map&lt;ICollection&lt;AIMConfigProfile&gt;&gt;(filteredStructuredData);
  </code></pre>