title: What is the first place in AspNetCore 3 where I can use IServiceProvider
body: <p>I want to provide a static class with <code>AutoMapper</code> configuration as soon as possible at application startup. The goal is to create custom mapping extensions, which internally call <code>ProjectTo</code> and <code>Map</code> and provide necessary configuration. That way I can have consistent and clean mapping API across the project:</p>
  
  <pre class="lang-cs prettyprint-override"><code>var articleDetails = this.dbContext
      .Articles
      .Map&lt;ArticleDetails();
  </code></pre>
  
  <p>to achieve that I need to provide my static <code>MappingExtensions</code> class with instance of <code>IMapper</code>, where I can get the configuration from. What is a good spot to do so in order to have that static class configured before I could hit any <code>Map</code> calls? There must be some sort of hook I can latch on after <code>IServiceProvider</code> has been initialized.</p>