✅ Can somone help me figure out why this doesn't deserialize?
public class Base
{
public int baseProp1;
}
public class Derived : Base
{
public string derivedProp;
}
var s = "{ "baseProp1": 1, "derivedProp": "foo"}";
var o = JsonSerializer.Deserialize<Derived>(s);
No exception is thrown but the values are 0 and null in the object o.
{
public int baseProp1;
}
public class Derived : Base
{
public string derivedProp;
}
var s = "{ "baseProp1": 1, "derivedProp": "foo"}";
var o = JsonSerializer.Deserialize<Derived>(s);
No exception is thrown but the values are 0 and null in the object o.