title: How to create JSON array using Newtonsoft.Json for this specific structure
body: <p>How do I create a JSON array using Newtonsoft.JSON (json.net) from this json string</p>
  
  <pre><code>[
    {
      "Cells": {
        "results": [
          {
            "Key": "Title",
            "Value": "hello",
            "ValueType": "Edm.String"
          },
          {
            "Key": "Size",
            "Value": "54549",
            "ValueType": "Edm.Int64"
          },
          {
            "Key": "Path",
            "Value": "http://somesite/a/hello.pptx",
            "ValueType": "Edm.String"
          },
          {
            "Key": "Summary",
            "Value": "Some summary &lt;ddd/&gt; interesting reading &lt;ddd/&gt; nice book &lt;ddd/&gt; ",
            "ValueType": "Edm.String"
          },
          {
            "Key": "Name",
            "Value": "http://somesite",
            "ValueType": "Edm.String"
          }
        ]
      }
    },
    {
      "Cells": {
        "results": [
          {
            "Key": "Title",
            "Value": "hi joe",
            "ValueType": "Edm.String"
          },
          {
            "Key": "Size",
            "Value": "41234",
            "ValueType": "Edm.Int64"
          },
          {
            "Key": "Path",
            "Value": "http://someothersite/interesting/hi.pptx",
            "ValueType": "Edm.String"
          },
          {
            "Key": "Summary",
            "Value": "Some summary &lt;ddd/&gt; interesting reading &lt;ddd/&gt; nice book &lt;ddd/&gt; ",
            "ValueType": "Edm.String"
          },
          {
            "Key": "Name",
            "Value": "http://somesite",
            "ValueType": "Edm.String"
          }
        ]
      }
    }
  ]
  </code></pre>
  
  <p>json2csharp gives me following classes for this structure</p>
  
  <pre><code>public class Result
  {
      public string Key { get; set; }
      public string Value { get; set; }
      public string ValueType { get; set; }
  }
  
  public class Cells
  {
      public List&lt;Result&gt; results { get; set; }
  }
  
  public class RootObject
  {
      public Cells Cells { get; set; }
  }
  </code></pre>
  
  <p>How do I use these classes to create json array?</p>
  
  <p><strong>UPDATE AND SOLUTION</strong></p>
  
  <p>this will work</p>
  
  <pre><code>static void Main(string[] args)
  {
      RootObject ro = new RootObject();
      Cells cs = new Cells();
      cs.results = new List&lt;Result&gt;();
  
      Result rt = new Result();
      rt.Key = "Title";
      rt.Value = "hello";
      rt.ValueType = "Edm.String";
      cs.results.Add(rt);
  
      Result rs = new Result();
      rs.Key = "Size";
      rs.Value = "3223";
      rs.ValueType = "Edm.Int64";
      cs.results.Add(rs);
  
      ro.Cells = cs;
  
      string json = JsonConvert.SerializeObject(ro);
  }
  </code></pre>