title: How to serialize an anonymous type to JSON, when JSON *needs* properties with characters like dashes '-' e.t.c
body: <p>I am building an app that uses Open Flash Chart 2. This chart is a flash object that accepts JSON with a specific structure.</p>
  
  <pre><code>"elements": [
  {
      "type": "bar_stack",
      "colours": [
          "#F19899",
          "#A6CEE3"
      ],
      "alpha": 1,
      "on-show": {
          "type": "grow-up",
          "cascade": 1,
          "delay": 0
      },
      ...
  </code></pre>
  
  <p>I am using a simple anonymous type to return the JSON like so:</p>
  
  <pre><code>return Json(new
  {
      elements = new [] {
          new
          {
              type = "bar_stack",
              colours = colours.Take(variables.Count()),
              alpha = 1,
              on_show = new
              {
                  type = "grow-up",
                  cascade = 1,
                  delay = 0
              },
              ...
          }
  }
  </code></pre>
  
  <p>The problem is that several properties (like "on-show") use a dash and obviously I cannot use a dash when naming a property in C# code.</p>
  
  <p>Is there a way to overcome this? Preferably without the need to declare a whole bunch of classes.</p>