Given a class
public class ClassTest
{
public string A { get; set; }
public string B { get; set; }
public string C { get; set; }
public D_type D { get; set; }
}
I am calling
JsonConvert.DeserializeObject<ClassTest>(json);
Which works fine with the D
object of class D_type
it correctly parses as I need it. However, I don't want JSON.net to deserialize D
, I want to do this instead
public class ClassTest
{
public string A { get; set; }
public string B { get; set; }
public string C { get; set; }
public string D_json { get; set; }
}
I want to keep D as the json string and not deserialize it.
I am going to use a different deserializer right afterwards to convert it to something else. It seems pointless to deserialize to an object D_type and then serialize it back to json, only to deserialize it again.
Seems I am able to do
and then just use
but I am still curious if there is a better way, specifically one that returns a real
JSONObject
or something I can add properties to