I have a nested class with static properties like this:
public class A {
public class B {
public static string BString = null;
}
}
Here is the JSON:
{
B {
"BString" : "Hello"
}
}
I want to deserialize this JSON so that it sets the nested static value (A.B.BString should contain the string Hello). I don't know a lot about newtonsoft but is there a way to get it to do this without me having to instantiate the B class. I don't want to have to change the class at all to get this to work. I know you can add the [JsonProperty] to static properties to get it to deserialize properly but this does not work with nested classes.
Newtonsoft, but there's almost definitely a better way to do what you need.