This is the JSON string:
{"name":"Chris","home":[],"children":[{"name":"Belle"},{"name":"O"}]}
I normally create custom object like this:
public class Child
{
public string name { get; set; }
}
public class RootObject
{
[DataMember]
public string name { get; set; }
[DataMember]
public List<object> home { get; set; }
[DataMember]
public List<Child> children { get; set; }
}
But now I don't want children as List,
I just want to record/serialize children as String, not Child. Meaning that I just don't mind keeping this part: [{"name":"Belle"},{"name":"O"}] as STRING, NOT Array/List.
How can I do that? I am using DataContractJSONSeriliazer.ReadObject method.

DataContractJSONSeriliazerbut I had similar need (to keep some part of JSON untouched) with Newtonsoft JSON.net. There I could useJObjectorJArrayclass as a serialization target to keep a field a plain JSON. Maybe you could find something similar.