I have several BusinessObject classes that reference each other, and I need to serialize them to JsonResponse and return it to my view. I keep getting the circular link exception, and I cannot get rid of it. I put a decorator [ScriptIgnore()]on every property that is not a simple data type property, and I still get an exception. I can't figure out where the problem is, because I am blocking the serializer from everything, and it still explodes.
Is there any way to see what the current state of a serialized object is?
[HttpPost]
public JsonResult GetAnalysisInfo(int id)
{
ProjectContext myDB = db;
SearchAnalysis searchanalysis = SearchAnalysis.Find(myDB, id);
return this.Json(searchanalysis);
}
Update
I also tried to implement ISerializable to no avail. My GetObjectData is very simple:
public void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("SearchAnalysisId", this.SearchAnalysisId);
info.AddValue("Created", this.Created);
}
- CircularRefernce. DateTime ?