title: How to register an AutoMapper profile with Unity
body: <p>I have the following AutoMapper profile:</p>
  
  <pre><code>public class AutoMapperBootstrap : Profile
  {
      protected override void Configure()
      {
          CreateMap&lt;Data.EntityFramework.RssFeed, IRssFeed&gt;().ForMember(x =&gt; x.NewsArticles, opt =&gt; opt.MapFrom(y =&gt; y.RssFeedContent));
          CreateMap&lt;IRssFeedContent, Data.EntityFramework.RssFeedContent&gt;().ForMember(x =&gt; x.Id, opt =&gt; opt.Ignore());
      }
  }
  </code></pre>
  
  <p>And I am initializing it like this:</p>
  
  <pre><code>var config = new MapperConfiguration(cfg =&gt;
  {
         cfg.AddProfile(new AutoMapperBootstrap());
  });
  
  container.RegisterInstance&lt;IMapper&gt;("Mapper", config.CreateMapper());
  </code></pre>
  
  <p>When I try to inject it in my constructor:</p>
  
  <pre><code>private IMapper _mapper;
  public RssLocalRepository(IMapper mapper)
  {
      _mapper = mapper;
  }
  </code></pre>
  
  <p>I recieve the following error:</p>
  
  <blockquote>
    <p>The current type, AutoMapper.IMapper, is an interface and cannot be
    constructed. Are you missing a type mapping?</p>
  </blockquote>
  
  <p>How can I initialize the AutoMapper profile properly with Unity, so that I can use the mapper anywhere through DI?</p>