title: ASP.NET Core Configuration Section in Startup
body: <p>I am migrating a ASP.NET 5 RC1 project to ASP.NET Core, and have come across an interesting issue I've not yet seen, or found a solution for.</p>
  
  <p>In order to use configuration settings within Startup I have previously retrived the configuration the following way</p>
  
  <pre><code>// Works fine for DI both in ASP.NET 5 RC1 and ASP.NET Core
  services.Configure&lt;SomeConfigurationClass&gt;(Configuration.GetSection("SomeConfigurationSection"));
  
  // How I previous retrieved the configuration for use in startup. 
  // No longer available in ASP.NET Core
  var someConfigurationToUseLater = Configuration.Get&lt;SomeConfigurationClass&gt;("SomeConfigurationSection");
  </code></pre>
  
  <p>After updating to ASP.NET Core 1.0 it seems Configuration.Get&lt;T&gt;() is no longer available.</p>
  
  <p>I have tried updating the code to use Configuration.GetValue&lt;T&gt;() however this does not seem to work with objects and will only work when providing a path to a value. This has left me with a workaround for <em>most</em> of my configuration classes like so</p>
  
  <pre><code>var someConfigurationName = "someConfiguration";    
  var someConfigurationClass = new SomeConfigurationClass()
  {
      Value1 = Configuration.GetValue&lt;string&gt;($"{someConfigurationName}:value1"),
      Foo = Configuration.GetValue&lt;string&gt;($"{someConfigurationName}:foo"),
      Bar = Configuration.GetValue&lt;string&gt;($"{someConfigurationName}:bar")
  };
  </code></pre>
  
  <p>However this is an issue when the configuration class contains an array of objects. In my case an array of Client objects</p>
  
  <pre><code>public class ClientConfiguration
  {
      public Client[] Clients { get; set; }
  }
  </code></pre>
  
  <p>With the following configuration</p>
  
  <pre><code>"configuredClients": {
    "clients": [
      {
        "clientName": "Client1",
        "clientId": "Client1"
      },
      {
        "clientName": "Client2",
        "clientId": "Client2"
      }
    ]
  }
  </code></pre>
  
  <p>Where this would previously bind to the Clients property of my configuration class no problem, I can no longer find a way of doing so in ASP.NET Core 1.0</p>