title: Make web api serialize dictionary with the key value as key using data attribute
body: <p>I have a dictionary which I am serializing using the json.net serializer, and it is currently producing </p>
  
  <pre><code>{"phrases":[{"Key":"my-key1","Value":"blah"},{"Key":"my-key2","Value":"blah2"}]}
  </code></pre>
  
  <p>however I want it to output</p>
  
  <pre><code>{"phrases":["my-key1":"blah"},{"my-key2":"blah2"}]}
  </code></pre>
  
  <p>my model looks like</p>
  
  <pre><code>public class Phrases
  {
      public Dictionary&lt;string, string&gt; phrases;
  }
  </code></pre>
  
  <p>Is there a data attribute I can apply to the phrases model to cause this to happen? </p>
  
  <p>I found the following but don't want to be returning a string <a href="https://stackoverflow.com/questions/6862177/serialize-into-a-key-value-dictionary-with-json-net">Serialize into a key-value dictionary with Json.Net?</a></p>
  
  <p>UPDATE: </p>
  
  <p>I am extending the web api controller as follows, if I use JsonConvert.SerializeObject() I do get the correct serialization , however I would then have a string to return.</p>
  
  <pre><code>public class PhraseController : ApiController
      {
          private IApplicationModel applicationModel;
  
          public Phrases Get(string id)
          {
              var locale = new CultureInfo(id).LCID;
              var phrases = applicationModel.Phrases.Where(x =&gt; x.Locale = locale).ToDictionary(x =&gt; x.Name, y =&gt; y.Value);
  
              return new Phrases() { phrases = phrases };
          }
  
          public PhraseController(IApplicationModel applicationModel)
          {
              this.applicationModel = applicationModel;
          }
      }
  </code></pre>