title: F#, Json.NET 6.0 and WebApi - serialization of record types
body: <p><a href="http://james.newtonking.com/archive/2014/02/01/json-net-6-0-release-1-%E2%80%93-jsonpath-and-f-support" rel="noreferrer">Json.NET 6.0.1</a> adds F# support for records and discriminated unions. When serializing a F# record type using Json.NET I now get nicely formatted JSON.</p>
  
  <p>The serialization is done as follow:</p>
  
  <pre><code>let converters = [| (new StringEnumConverter() :&gt; JsonConverter) |]
  JsonConvert.SerializeObject(questionSet, Formatting.Indented, converters)
  </code></pre>
  
  <p>However, when I try to expose my F# types through a ASP.NET WebApi 5.0 service, written in C#, the serialized JSON includes an @-sign infront of all properties. The @-sign comes from the internal backing field for the record type (this used to be a known problem with Json.Net and F#).</p>
  
  <p>But - since I'm using the updated version of Json.NET, shouldn't the result be the same as when calling JsonConvert? Or is <code>JsonConvert</code> behaving differently than <code>JsonTextWriter</code>and <code>JsonTextReader</code>?</p>
  
  <p>As far as I can tell from reading the <code>JsonMediaTypeFormatter</code> in the  WebApi source <code>JsonTextWriter</code>and <code>JsonTextReader</code> is used by WebApi.</p>