title: Migration to .net6, problem with settings
body: <p>I am moving code from .net 4.6.1 to .net 6 API. There is a lot of code using: <code>ConfigurationManager.AppSettings[&quot;something&quot;].ToString()</code>
  to read <em>App.config</em></p>
  <p>In .net6 we use <em>appsettings.json</em> and read it with <em>dependency injection</em></p>
  <p>for example:</p>
  <pre><code>private readonly IOptions&lt;Configs&gt; _configs;
  public WeatherForecastController(IOptions&lt;Configs&gt; configs)
  {
    _configs = configs;
  }
  public IEnumerable&lt;WeatherForecast&gt; Get()
  {
    var valFromConfig = _configs.Value.Val;
  }
  </code></pre>
  <p>How can read settings without passing <em>_configs</em> as parameter of the method?</p>
  <pre><code>public IEnumerable&lt;WeatherForecast&gt; Get()
  {
    var ret = MyClass.GetConfigVal();
  }
  </code></pre>
  <p>where MyClass in old solution:</p>
  <pre><code>public class MyClass
      {
          public static string GetConfigVal()
          {
              return ConfigurationManager.AppSettings[&quot;something&quot;].ToString(); // How to change this
          }
      }
  </code></pre>