Based on Wes Grants answer in this thread: Serializing Entity Framework problems
I tried the following code:
string sid = HttpContext.Current.Request["Sid"];
SYSTEM system = context.SYSTEM.Where(s => s.SYSTEM_ID.Contains(sid)).First();
context.Detach(system);
HttpContext.Current.Response.Write(serializer.Serialize(system));
But I still get the circular reference exception. Did I miss something obvious here? Thanks