title: Newtonsoft.Json C# :: Formatting JsonConvert.SerializeObject
body: <p>I have following classes,</p>
  
  <pre><code>  public class Actions
          {
              public string say { get; set; }
              public bool? listen { get; set; }
          }
  
          public class ActionsWrapper 
          { 
              public List&lt;Actions&gt; actions { get; set; }
              public ActionsWrapper(string say, bool listen = false)
              {
                  this.actions = new List&lt;Actions&gt;();
  
                  var action = new Actions();
                  action.say = say;
                  action.listen = listen;
                  this.actions.Add(action);
              }
          }
  </code></pre>
  
  <p>And I am using the following to generate Json</p>
  
  <pre><code>var actions = new ActionsWrapper(say: "Hi, how can I help you today?");
  return JsonConvert.SerializeObject(actions);
  </code></pre>
  
  <p>This returns me following Json,</p>
  
  <pre><code>{"actions":[
        {
          "say":"Hi, how can I help you today?",
           "listen": false
         }
  ]}
  </code></pre>
  
  <p>Which is good, but I am sending this to Twilio API which has the requirement of the following format,</p>
  
  <pre><code>{
    "actions": [
      {
        "say": "Hi, how can I help you today?"
      },
      {
        "listen": false
      }
    ]
  }
  </code></pre>
  
  <p>So my question is, what changes do I need in my classes / NewtonSoft to get each property [say&amp;listen] in separate curly braces? </p>