I am using ASP.NET MVC3 and one of my action methods is set up to return a Json response:
[HttpPost]
public JsonResult AddUser(User user)
{
... do something to user and return it ...
return Json(user);
While processing with Entity Framework, the user object gets a few child objects. Json serializer is likely to be unable to cope with the entire object graph, and returns InvalidOperationError error (about a circular reference being identified).
I do not need any of the child objects actually, and I would like to get user serialized without child objects. How I can achieve this?
Thank you in advance!