title: MVC3 JSON Serialization: How to control the property names?
body: <p>I want to serialize a simple object to JSON:</p>
  
  <pre><code>public class JsonTreeNode
  {
      [DataMember(Name = "title")]
      public string Title { get; set; }
  
      [DataMember(Name = "isFolder")]
      public bool IsFolder { get; set; }
  
      [DataMember(Name = "key")]
      public string Key { get; set; }
  
      [DataMember(Name = "children")]
      public IEnumerable&lt;JsonTreeNode&gt; Children { get; set; }
  
      [DataMember(Name = "select")]
      public bool SelectedOnInit { get; set; }
  }
  </code></pre>
  
  <p>But whenever I do it:</p>
  
  <pre><code>return Json(tree, JsonRequestBehavior.AllowGet);
  </code></pre>
  
  <p>The property names are not as specified in the <code>[DataMember]</code> section, but similar to the ones defined directly in the class e.g. in the case of <code>SelectOnInit</code> it is not <code>select</code> but <code>SelectOnInit</code>.</p>
  
  <p>What am I doing wrong?</p>