title: Escape c# class property from JSON serialization (to remove quotes)
body: <p><strong>I EDITED THE SOLUTION BELOW THE QUESTION !!!</strong></p>
  
  <hr>
  
  <p>I have read like 30 similar articles on this, but nothing quite hits the spot.</p>
  
  <p>My scenario: in order to feed a charting library (highcharts/highstock) with data in ASP.NET I  manually created the basic classes for such a graph. This is due to the fact that all the wrapper projects work for highcharts but NOT for highstock. However, highstock requires a HTML script block like this (working):</p>
  
  <pre><code>&lt;script&gt;
  $('#container2').highcharts('StockChart',
  {
  "title": {
      "text": "Graph_Title_string"
  },
  "yAxis": {
      "title": {
          "text": "YAxis_Title_string"
      },
      "height": 200,
      "lineWidth": 2,
      "top": 80
  },
  "series": [
    {
        "type": "line",
        "name": "Testdata",
        "data": [[Date.UTC(2014, 3, 8, 0, 0), 3], [Date.UTC(2014, 3, 9, 0, 0), 2], [Date.UTC(2014, 3, 10, 0, 0), 4], [Date.UTC(2014, 3, 11, 0, 0), 4], [Date.UTC(2014, 3, 12, 0, 0), 3], [Date.UTC(2014, 3, 13, 0, 0), 4], [Date.UTC(2014, 3, 14, 0, 0), 2], [Date.UTC(2014, 3, 15, 0, 0), 1], [Date.UTC(2014, 3, 16, 0, 0), 4], [Date.UTC(2014, 3, 17, 0, 0), 0]]
    }]
  });
  </code></pre>
  
  <p></p>
  
  <p>I created the c# classes and their properties, as for example:</p>
  
  <pre><code>public class Series
  {
      public string type { get; set; }
      public string name { get; set; }
      public object data { get; set; }    
  }
  </code></pre>
  
  <p>Later on I use JsonConvert.SerializeObject to serialize my chart-object (with instanced classes title, yAxis, series etc within), which results in following output:</p>
  
  <pre><code>{
    "title": {
      "text": "Graph_Title_string"
    },
    "yAxis": {
      "title": {
        "text": "YAxis_Title_string"
      },
      "height": 200,
      "lineWidth": 2,
      "top": 0
    },
    "series": [
      {
        "type": "line",
        "name": "Testdata",
        "data": "[[Date.UTC(2014, 3, 8, 0, 0), 3],[Date.UTC(2014, 3, 9, 0, 0), 2],[Date.UTC(2014, 3, 10, 0, 0), 0],[Date.UTC(2014, 3, 11, 0, 0), 4],[Date.UTC(2014, 3, 12, 0, 0), 4],[Date.UTC(2014, 3, 13, 0, 0), 2],[Date.UTC(2014, 3, 14, 0, 0), 1],[Date.UTC(2014, 3, 15, 0, 0), 1],[Date.UTC(2014, 3, 16, 0, 0), 0],[Date.UTC(2014, 3, 17, 0, 0), 3]]"
      }
    ]
  }
  </code></pre>
  
  <p>So the problem is: the value of series->data is enclosed in quotes. As highstock obviously requires an object array as data ([[DateTime, value],[DateTime, value],...etc]), the chart is not rendered unless I remove these quotes around the array.</p>
  
  <p>When the array was "pure" integer there would be no quotes (I guess), but as my points need to be DateTime/value I need an array of objects. </p>
  
  <p>Therefore the question: <strong>how can I force my JSON serializer to NOT enclose my value of an object array in quotes?</strong></p>
  
  <p>Maybe this is trivial and simple, and I was looking to far. As said, I've read lots of articles on similar problems, but nothing worked for me. Any help highly appreciated!</p>
  
  <hr>
  
  <p><strong>SOLUTION</strong>:</p>
  
  <p>the data-array in my series-node is int/double - DATE.UTC(2014, 3, 8, 0, 0) doesn't return a DateTime but a NUMBER (reference: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/UTC</a>)</p>
  
  <p>Therefore defining a double array in my behind-class will result in the desired output format (as seen in the great suggestion below by craig and also the marked answer) without the quotation marks. </p>
  
  <p>Code (reference: <a href="http://forums.asp.net/post/1463013.aspx" rel="nofollow">http://forums.asp.net/post/1463013.aspx</a> ... however, slightly modified) for converting c# DateTime to the required milliseconds-timestamp:</p>
  
  <pre><code>public double MilliTimeStamp(DateTime d2)
          {
              DateTime d1 = new DateTime(1970, 1, 1);
              TimeSpan ts = new TimeSpan(d2.Ticks - d1.Ticks);
  
              return ts.TotalMilliseconds;
          }
  </code></pre>