I have a json custom converter using the standard asp.net library. My converter looks like this:
public class MyObjectToJson : JavaScriptConverter
public override IDictionary<string, object> Serialize(object obj, JavaScriptSerializer serializer)
{
MyObject TheObject = obj as MyObject;
Dictionary<string, object> OutputJson = new Dictionary<string, object>();
OutputJson.Add("SomeProperty", TheObject.Property1);
//line that I'm not figuring out
//I have a type MyNestedObject nested in the object model of MyObject
//I added that nested converter in the SupportedTypes method
OutputJson.Add("TheNestedObject",....?);
return OutputJson;
}
public override IEnumerable<Type> SupportedTypes
{
get { return new Type[] { typeof(MyObject), typeof(MyNestedObject) }; }
}
Basically, I have another json custom converter that's called MyNestedObjectJson but I'm wondering where to plug it in.