title: Serializing an object containing a Dictionary such that the Dictionary keys/values are rendered as part of the containing object
body: <p>I have a class as follows: </p>
  
  <pre><code>public class Usage
  {
      public string app { get; set; }
  
      public Dictionary&lt;string, string&gt; KVPs { get; set; }
  }
  </code></pre>
  
  <p>When I use this code:</p>
  
  <pre><code>var json = new JavaScriptSerializer().Serialize(usage);
  </code></pre>
  
  <p>it gives me this JSON: </p>
  
  <pre><code>{"app":"myapp", "KVPs":{"k1":"v1", "k2":"v2"}}
  </code></pre>
  
  <p>I'd like it to return something like this instead:</p>
  
  <pre><code>{"app":"myapp", "k1":"v1", "k2":"v2"}
  </code></pre>
  
  <p>Is there a way to do this?  I am currently using the <code>JavaScriptSerializer</code>.  If there is a way to do this using JSON.Net, I would be willing to switch to that.</p>