title: Serialize Entity Framework objects into JSON
body: <p>It seems that serializing Entity Framework objects into JSON is not possible using either WCF's native DataContractJsonSerializer or ASP.NET's native JavaScript serializer. This is due to the reference counting issues both serializers reject. I have also tried <a href="http://james.newtonking.com/projects/json-net.aspx" rel="nofollow noreferrer">Json.NET</a>, which also fails specifically on a Reference Counting issue.</p>
  
  <hr>
  
  <p><strong>Edit:</strong> Json.NET can now <a href="http://james.newtonking.com/archive/2009/07/10/ado-net-entity-framework-support-accidently-added-to-json-net.aspx" rel="nofollow noreferrer">serialize and deserialize Entity Framework entities</a>.</p>
  
  <hr>
  
  <p>My objects are Entity Framework objects, which are overloaded to perform additional business functionality (eg. authentication, etc.) and I do not want to decorate these classes with platform-specific attributes, etc. as I want to present a platform-agnostic API.</p>
  
  <p>I've actually blogged about the individual steps I went though at <a href="https://blog.programx.co.uk/2009/03/18/wcf-json-serialization-woes-and-a-solution/" rel="nofollow noreferrer">https://blog.programx.co.uk/2009/03/18/wcf-json-serialization-woes-and-a-solution/</a></p>
  
  <p>Have I missed something obvious?</p>