Monthly Archives: November 2014

Entity Frameworks, WebApi, JSON.Net and Serializing Circular References – Better fix

As an improvement on yesterday problem and solution, there is a simple change to the JSON.Net settings which solves this issue, just add this into Global.asax: JsonSerializerSettings settings = new JsonSerializerSettings {     PreserveReferencesHandling = PreserveReferencesHandling.Objects,     Formatting = Formatting.Indented }; HttpConfiguration config = GlobalConfiguration.Configuration; config.Formatters.JsonFormatter.SerializerSettings = settings;

Posted in Uncategorized | Leave a comment

Entity Frameworks, WebApi, JSON.Net and Serializing Circular References

While Entity Frameworks handles circular references between models very well, putting them through a WebApi web service and serializing them, Json.Net starts throwing errors. The quickest way around this is to rebuild the objects and miss out the references from … Continue reading

Posted in Uncategorized | Leave a comment