title: generate category tree structure json data?
body: <p><strong>Category Table:</strong></p>
  
  <p>ID => int, primary key</p>
  
  <p>CategoryName => varchar</p>
  
  <p>ParentCategoryID => int , nullable</p>
  
  <p><strong>Generate following json data format:</strong></p>
  
  <pre><code>[{
      "id":1,
      "name":"Root",
      "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
      "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;",
      "children":[{
          "id":2,
          "name":"Horoscope",
          "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
          "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;",
          "children":[{
              "id":21,
              "name":"Daily",
              "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
              "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;",
              "children":[{
                  "id":211,
                  "name":"Aries",             
                  "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
                  "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;"
              },{
                  "id":212,
                  "name":"Taurus",                
                  "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
                  "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;"
              }]
          },{
              "id":22,
              "name":"Weekly",            
              "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
              "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;",
              "children":[{
                  "id":221,
                  "name":"Gemini",                
                  "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
                  "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;"
              },{
                  "id":222,
                  "name":"Aries",             
                  "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
                  "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;"
              },{
                  "id":223,
                  "name":"Taurus",            
                  "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
                  "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;"
              }]
          }]
      },{
          "id":3,
          "name":"News",      
          "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
          "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;",
          "children":[{
              "id":31,
              "name":"Sports",            
              "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
              "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;"
          },{
              "id":32,
              "name":"Interantional",         
              "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
              "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;"
          },{
              "id":33,
              "name":"Entertaintment",            
              "Edit":"&lt;a href='Edit/id'&gt;edit.png&lt;/a&gt;",
              "Delete":"&lt;a href='Delete/id'&gt;delete.png&lt;/a&gt;"
          }]
      }]
  }]
  </code></pre>
  
  <p>I have Jquery TreeGrid Plugins which needs above json format. How Can I generate above json data from category table of database and return json data in controller action. I have use entity framework for model.</p>