Actually read AppSettings in ConfigureServices phase in ASP.NET Core : <p>I need to setup a few dependencies (services) in the <code>ConfigureServices</code> method in an ASP.NET Core 1.0 web application.</p>

<p>The issue is that based on the new JSON configuration I need to setup a service or another. </p>

<p>I can't seem to actually read the settings in the <code>ConfigureServices</code> phase of the app lifetime:</p>

<pre><code>public void ConfigureServices(IServiceCollection services)
{
    var section = Configuration.GetSection("MySettings"); // this does not actually hold the settings
    services.Configure&lt;MySettingsClass&gt;(section); // this is a setup instruction, I can't actually get a MySettingsClass instance with the settings
    // ...
    // set up services
    services.AddSingleton(typeof(ISomething), typeof(ConcreteSomething));
}
</code></pre>

<p>I would need to actually read that section and decide what to register for <code>ISomething</code> (maybe a different type than <code>ConcreteSomething</code>).</p>
