Json.net serialisation issue when returning Entity Framework models in Web API

It’s very typical for Entity Framework models to have circular references. For example:

This, however, will cause serialisation error when returning these EF models in Web API controller because it detects that there are circular references. The json serialiser does not know how to handle circular reference.

There are a few solutions to … [Read more…]