title: Mapping class array using AutoMapper
body: <p>I'm new to AutoMapper and trying to map <code>Array</code> class <code>ItemLink[]</code>. </p>
  
  <pre><code>public class ViewModel
  {
    public ItemLink[] ItemLinks { get; set; }
  }
  
  public class ItemLink
  {
    public string Description { get; set; }
  }
  </code></pre>
  
  <p><strong>I tried:</strong></p>
  
  <pre><code>Mapper.Map&lt;viewModel.ItemLink&gt;(db.ItemLinks);
  </code></pre>
  
  <p><strong>Error:</strong> </p>
  
  <blockquote>
    <p>"Mapper not initialized. Call Initialize with appropriate configuration. If you are trying to use mapper instances through a container or otherwise, make sure you do not have any calls to the static Mapper.Map methods, and if you're using ProjectTo or UseAsDataSource extension methods, make sure you pass in the appropriate IConfigurationProvider instance."</p>
  </blockquote>
  
  <p>Can't it be simple mapping?</p>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>To clarify more, I'm getting similar class structure from database. Example,</p>
  
  <pre><code>public class Db
  {
    public ItemLink[] ItemLinks { get; set; }
  }
  </code></pre>
  
  <p>So, I want to map <code>ViewModel.ItemLink[]</code> with <code>Db.ItemLink[]</code>.</p>