title: Creating a JSON array in C#
body: <p>Ok, so I am trying to send POST commands over an http connection, and using JSON formatting to do so.  I am writing the program to do this in C#, and was wondering how I would format an array of values to be passed as JSON to the server.  </p>
  
  <p>Currently I have this:</p>
  
  <p><code>new {name = "command" , index = "X", optional = "0"}</code></p>
  
  <p>Which translates to this in JSON:</p>
  
  <pre><code>"name": "command",
  "index": "X",
  "optional": "0"
  </code></pre>
  
  <p>And I want to make an array, called items, where each element contains these three values.  So it would essentially be an array of objects, in which the object contains a name, an index, and an optional field.</p>
  
  <p>My guess was that it would be something along the lines of this:</p>
  
  <pre><code>new {items = [(name = "command" , index = "X", optional = "0"), 
                (name = "status" , index = "X", optional = "0")]}
  </code></pre>
  
  <p>Which, if it were correct syntax, would translate to this in JSON:</p>
  
  <pre><code>"items": 
  [
      {
          "name": "command",
          "index": "X",
          "optional": "0"
      },
      {
          "name": "status",
          "index": "X",
          "optional": "0"
      }
  ]
  </code></pre>
  
  <p>But, evidently I'm doing it wrong.  Ideas?  Any help is appreciated.</p>