Circular Reference exception with JSON Serialisation with MVC3 and EF4 CTP5w

前端 未结 5 1943
一生所求
一生所求 2020-12-10 12:42

I\'m having problems with a circular reference when i try and serialise an object returned via EF4 CTP5. Im using the code first approach and simple poco\'s for my model.

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-10 13:14

    No matter what I did the dynamic proxies kept being a sticking point, I went as far as removing all circular references in my model! but still the problem persisted.

    I tried Json.Net but the same problem occurred.

    In the end I stumbled upon a post about using a custom JavaScriptConverter

    http://hellowebapps.com/2010-09-26/producing-json-from-entity-framework-4-0-generated-classes/

    Implemented the code and bobs your uncle everything worked

提交回复
热议问题