title: c# load Json into inherited class
body: <p>I have a C# classes and I need to parse JSON into it.</p>
  
  <p>The class has a <code>List&lt;&gt;</code> from another class. </p>
  
  <p>The class structure is like this.</p>
  
  <pre class="lang-c# prettyprint-override"><code>public class OrderFund {
    public int OrderID { get; set; }
    public int BrokerID { get; set; }
    public string SettlementMethod { get; set; }
    public List&lt;SettlementSap&gt; SettlementsSap { get; set; }
  }
  
  public class SettlementSap {
    public string SapMonetaryAccountNo { get; set; }
    public string SapMonetaryAccountType { get; set; }
    public string SapMonetaryAccountOffice { get; set; }
  }
  </code></pre>
  
  <p>My JSON is like this.</p>
  
  <pre class="lang-js prettyprint-override"><code>{
    "settlementMethod": "SAP",
    "BrokerID": 1,
    "OrderID": 1,
    "Settlements": [
      {
        "SapMonetaryAccountNo": "400245892464",
        "SapMonetaryAccountType": "CA",
        "SapMonetaryAccountOffice": "AR"
      }
    ]
  }
  </code></pre>
  
  <p>I load my JSON file like this...</p>
  
  <pre class="lang-c# prettyprint-override"><code>static OrderFund LoadJson(string file) {
    string dire = Directory.GetCurrentDirectory();
    using (StreamReader r = new StreamReader(dire + "\\" + file)) {
      string json = r.ReadToEnd();
      OrderFund items = JsonConvert.DeserializeObject&lt;OrderFund&gt;(json);
      return items;
    }
  }
  </code></pre>
  
  <p>The data load fine into <code>OrderFun</code> Class but <code>OrderFund.SettlementsSap</code> is null.
  How can I load <code>Settlements</code> into <code>SettlementsSap</code>?</p>