title: Why does the configuration of .NET Core options not work with a generic type parameter?
body: <p>I have a .NET Core WebApi project. To read the appsettings in an easy way, I configure the options to be injected with DI. This works fine. However if I try to call <code>Configure&lt;&gt;()</code> with a generic type parameter, I get an error.</p>
  
  <blockquote>
    <p>Argument 2: cannot convert from 'Microsoft.Extensions.Configuration.IConfigurationSection' to 'System.Action'</p>
  </blockquote>
  
  <p>The method overloads apart from <code>Configure&lt;T&gt;(Action&lt;T&gt; configureOptions)</code> seem not to be available anymore.</p>
  
  <p><strong>Why does the call not work with generic type parameters?</strong></p>
  
  <p>Startup.cs</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class Startup
  {
      public IConfiguration Configuration { get; }
  
      public Startup(IConfiguration configuration)
      {
          Configuration = configuration;
      }
  
      public void ConfigureServices(IServiceCollection services)
      {
          // services.AddMvc() etc...
  
          services.AddOptions();
  
          // Works fine
          services.Configure&lt;MyOption&gt;(Configuration.GetSection(nameof(MyOption)));
      }
  
      private void AddOption&lt;T&gt;(IServiceCollection services)
      {
          // Wont work
          services.Configure&lt;T&gt;(Configuration.GetSection(nameof(T)));
          services.Configure&lt;T&gt;(Configuration.GetSection(""));
      }
  }
  </code></pre>
  
  <p>MyOption.cs</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class MyOption
  {
      public bool MyProp { get; set; }
  }
  </code></pre>
  
  <p>appsettings.json</p>
  
  <pre class="lang-json prettyprint-override"><code>{
      "MyOption": {
          "MyProp": true
      }
  }
  </code></pre>