title: Trying to add AutoMapper to Asp.net Core 2?
body: <p>I worked on a asp.net core 1.1 project a while ago and use in projetc AutoMapper.</p>
  
  <p>in asp.net core 1.1, I add <code>services.AddAutoMapper()</code> in startup file :</p>
  
  <p><strong>StartUp file in asp.net core 1.1:</strong></p>
  
  <pre><code>    public void ConfigureServices(IServiceCollection services)
      {
          //Some Code
  
          services.AddMvc();
          services.AddAutoMapper();
      }
  </code></pre>
  
  <p>And I use AutoMapper in Controller easily.</p>
  
  <p><strong>Controller :</strong></p>
  
  <pre><code> public async Task&lt;IActionResult&gt; AddEditBook(AddEditBookViewModel model)
   {
      Book bookmodel = AutoMapper.Mapper.Map&lt;AddEditBookViewModel, Book&gt;(model);
      context.books.Add(bookmodel);
      context.SaveChanges();
   }
  </code></pre>
  
  <p>And everything was fine.
  But I'm currently working on a Asp.net Core 2 project and I get the error with <code>services.AddAutoMapper()</code> in sturtap file.</p>
  
  <blockquote>
    <p>Error CS0121  The call is ambiguous between the following methods or properties: 'ServiceCollectionExtensions.AddAutoMapper(IServiceCollection, params Assembly[])' and 'ServiceCollectionExtensions.AddAutoMapper(IServiceCollection, params Type[])'</p>
  </blockquote>
  
  <p>What is the reason for this error?
  Also, <code>services.AddAutoMapper</code> in asp.net core 2 has some parameters. what should I send to this parameter?</p>