title: automapper, mapping to an interface
body: <p>I am using automapper (for .net 3.5). Here is an example to illustrate what I am trying to do:</p>
  
  <p>I want to map an A object to a B object. Class definitions:</p>
  
  <pre><code>class A
  {
      public I1 MyI { get; set; }
  
  }
  class B
  {        
      public I2 MyI { get; set; }
  }
  
  interface I1
  {
      string StringProp1 { get; }
  }
  interface I2
  {
      string StringProp1 { get; }
  }
  
  class CA : I1
  {
      public string StringProp1
      {
          get { return "CA String"; }
      }
      public string StringProp2 { get; set; }
  }
  class CB : I2
  {
      public string StringProp1
      {
          get { return "CB String"; }
      }
      public string StringProp2 { get; set; }
  }
  </code></pre>
  
  <p>The mapping code:</p>
  
  <pre><code>        A a = new A()
          {
              MyI = new CA()
          };
          // Mapper.CreateMap ...?
          B b = Mapper.Map&lt;A,B&gt;(a);
  </code></pre>
  
  <p>I want the resulting object b to be populated with an instance of CB. So automapper needs to know that A maps to B, CA maps to CB, and when creating a B populate it's MyI prop with a CB, how do I specify this mapping?</p>