title: Automapper custom converter for open generic
body: <p>Mapping <a href="https://github.com/AutoMapper/AutoMapper/wiki/Open-Generics" rel="nofollow noreferrer">open generics</a> is possible in Automapper, however I have come accros some issue trying to combine it with custom type converters.</p>
  <p>The following</p>
  <pre><code>cfg.CreateMap(typeof(IEnumerable&lt;&gt;), typeof(MyCustomCollectionType&lt;&gt;))
  .ConvertUsing(typeof(MyConverter));
  </code></pre>
  <p>with MyConverter looking like this:</p>
  <pre><code>class MyConverter : ITypeConverter&lt;object, object&gt;
  {
      public object Convert(object source, object destination, ResolutionContext context)
      {
          //... do conversion
      }
  }
  </code></pre>
  <p>does just throw an exception when the mapping is created:</p>
  <blockquote>
  <p>'System.InvalidOperationException' in mscorlib.dll</p>
  <p>Additional information: This operation is only valid on generic types.</p>
  </blockquote>
  <p>How can I define a custom type converter for open generic types? What interface do I need to implement?</p>