title: .Net core web api configure services before Startup is called
body: <p>I'm creating .net core 3.1 web api application. By default, it is configured to use <code>IHostBuilder</code> with <code>Startup</code> file which does some configurations</p>
  
  <pre><code> public static IHostBuilder CreateHostBuilder(string[] args) =&gt;
          Host.CreateDefaultBuilder(args)
              .ConfigureWebHostDefaults(webBuilder =&gt;
              {
                  webBuilder.UseStartup&lt;Startup&gt;();
              });
  </code></pre>
  
  <p>I want to add some configurations into my <code>Startup</code> file (events producing) and the problem is that they will not be executed on the application startup but only when api receives the first request.
  That means that my hosted application won't be able to handle events before it gets a request.
  So the question is: How can I invoke configuration methods from the <code>Startup</code> file on the application start or how can I do specific configuration that will be executed on the application start?</p>