title: How do I map a complex object with Automapper?
body: <p>I have several classes:</p>
  
  <pre><code>public class Customer
  {
      public string FirstName { get; set; }
  
      public string LastName { get; set; }
  
      public Product Product { get; set; }
  }
  
  public class Product
  {
      public string Name { get; set; }
  }
  
  
  public class Customer_
  {
      public string FirstName { get; set; }
  
      public string LastName { get; set; }
  
      public Article Article { get; set; }
  }
  
  public class Article
  {
      public string ArticleName { get; set; }
  }
  </code></pre>
  
  <p>And one instance: </p>
  
  <pre><code>Customer[] Customer = new Customer[]
  {
      new Customer()
      {
          FirstName = "FirstName1",
          LastName = "LastName1",
          Product =  new Product()
          {
              Name = "Product1"
          }
      },
      new Customer()
      {
          FirstName = "FirstName2",
          LastName = "LastName2",
          Product =  new Product()
          {
              Name = "Product2"
          }
      }
  };
  </code></pre>
  
  <p>I want to map this instance to a <code>Customer_</code> object where <code>Customer.Product.Name</code> = <code>Customer_.Article.ArticleName</code></p>
  
  <p>I use Automapper: </p>
  
  <pre><code>var config = new MapperConfiguration(cfg =&gt;
  {
      cfg.CreateMap&lt;Product, Article&gt;()
      .ForMember(dest =&gt; dest.ArticleName, opt =&gt; opt.MapFrom(src =&gt; src.Name));
  
  });
  
  IMapper mapper = config.CreateMapper();
  var desti = mapper.Map&lt;Customer[], Customer_[]&gt;(Customer);
  </code></pre>
  
  <p>But I have a exception: </p>
  
  <pre><code>Missing type map configuration or unsupported mapping.
  
  Mapping types:
  Customer -&gt; Customer_
  Xml_Test.Customer -&gt; Xml_Test.Customer_
  
  Destination path:
  Customer_[][0]
  
  Source value:
  Xml_Test.Customer
  </code></pre>
  
  <p>What is wrong?</p>