title: How to parse json settings in appsettings.json into a class in c# .netcore
body: <p>I have a appsettings.json that look like this</p>
  <pre><code>{
    &quot;AppName&quot;: &quot;my-app-service&quot;,
    &quot;MyModel&quot;: {
      &quot;MyList&quot;: [{
        &quot;CountryCode&quot;: &quot;jp&quot;
      },{
        &quot;CountryCode&quot;: &quot;us&quot;
      }]
    }
  }
  </code></pre>
  <p>Now, i have a POCO file, (MyList.cs is ommited, it has a single string key countryCode)</p>
  <pre><code>public class MyModel
  {
      public IList&lt;MyList&gt; MyList;
  }
  </code></pre>
  <p>I wish to make it so that MyModel can be injected anywhere in my code, how do I do that? I see that people do this in their setup.cs</p>
  <pre><code>    services.Configure&lt;MyModel&gt;(Configuration.GetSection(&quot;MyModel&quot;));
  </code></pre>
  <p>How ever it looks like when I use <code>IOption&lt;MyModel&gt;</code> in my code in the contructors, I just get null value. Where am I wrong?</p>