title: How to use IOptions pattern in Program.cs in .NET6, before builder.build()?
body: <p>Using the options pattern in .NET6, I can get access to some config values as follows:</p>
  <pre><code>builder.Services.Configure&lt;ApiConfiguration&gt;(
      builder.Configuration.GetSection(ApiConfiguration.Api));
  
  var app = builder.Build();
  
  var options = app.Services.GetRequiredService&lt;IOptions&lt;ApiConfiguration&gt;&gt;().Value;
  </code></pre>
  <p>However, I would like to get the Options <strong>before builder.Build()</strong>, so I can use the appSettings values when adding some Services to the ServiceCollections.</p>
  <p>I haven't been able to find it anywhere yet, so I am wondering if it is even possible (and how ofcourse :D )</p>