title: Using AutoMapper in .NET Core in a Library project
body: <p>This is the solution structure:</p>
  
  <ul>
  <li>MyProject.WebApplication  </li>
  <li>MyProject.Core</li>
  <li>MyProject.DAL</li>
  </ul>
  
  <p>The services are located in MyProject.Core. So I want to use a mapping there between the models that come from MyProject.DAL. (<code>Install-Package AutoMapper.Extensions.Microsoft.DependencyInjection</code>)</p>
  
  <pre><code>return _mapper.Map&lt;Core.Model&gt;(DAL.model);
  </code></pre>
  
  <p>and of course vice versa.</p>
  
  <p>The question is: do I need to reference the AutoMapper in both projects?</p>
  
  <p>Or create a <code>ConfigureAutoMapper</code> class in MyProject.Core and call it in the startup class of <code>MyProject.WebApplication</code>?</p>
  
  <p>But what about this?</p>
  
  <pre><code>services.AddAutoMapper();
  </code></pre>