Here is a screenshot of my design dbml file.
Relations are automatically generated by the foreign keys of the tables.

When I try to serialize the result query in JSON, I get a circular reference error ..:
public ActionResult Index() { return Json(new DataContext().Ingredients.Select(i => i)); }
But if I create my own collection of Ingredient bare objects, everything works fine ..:
public ActionResult Index() { return Json(new Entities.Ingredient[] { new Entities.Ingredient(), new Entities.Ingredient(), new Entities.Ingredient() }); }
... Also; Serialization works fine if I delete relationships on my tables.
How can I serialize objects with links without accessing a third-party library?
I can only do fine with serializing the top-level objects of this collection. without serializing relationships.
source share