title: To add a JSON Array inside a JSON object in C#
body: <p>Am working in MVC. In my controller am creating a list</p>
  
  <pre><code> public class GridColModelLst
      {
          List&lt;GridColModel&gt; _items = new List&lt;GridColModel&gt;();
  
          public List&lt;GridColModel&gt; items
          {
              get { return _items; }
              set { _items = value; }
          }
      }
  
  
      public class GridColModel
          {
              public string name { get; set; }
              public int? width { get; set; }
      }
  </code></pre>
  
  <p>And passing this list as JSON which works fine and my JSON is below</p>
  
  <pre><code>[{ name: 'Humidity', width: 90}]
  </code></pre>
  
  <p>How do i make it like the below JSON To add a JSON Array inside a JSON object in C#</p>
  
  <pre><code>[{ name: 'Humidity', width: 90, searchoptions: { sopt: ['eq', 'ne'] } }]
  </code></pre>
  
  <p>Thanks</p>
  
  <p>====================</p>
  
  <p>update</p>
  
  <p>In my controller am sending the list like</p>
  
  <pre><code>return Json(Colmodel, JsonRequestBehavior.AllowGet);
  </code></pre>
  
  <p>and am getting  <code>[{ name: 'Humidity', width: 90}]</code>  succesfully</p>
  
  <p>What changes i need for the class to get a JSON like </p>
  
  <pre><code>[{ name: 'Humidity', width: 90, searchoptions: { sopt: ['eq', 'ne'] } }]
  </code></pre>