title: Create Json dynamically in c#
body: <p>I need to create a Json object dynamically by looping through columns.
  so declaring an empty json object then add elements to it dynamically.</p>
  
  <p>eg:</p>
  
  <pre><code>List&lt;String&gt; columns = new List&lt;String&gt;{"FirstName","LastName"};
  
  var jsonObj = new {};
  
  for(Int32 i=0;i&lt;columns.Count();i++)
      jsonObj[col[i]]="Json" + i;
  </code></pre>
  
  <p>And the final json object should be like this: </p>
  
  <pre><code>jsonObj={FirstName="Json0", LastName="Json1"};
  </code></pre>