更新时间:2023-09-05 21:28:04
我相信您可以使用json.NET的property属性系统来更正此问题,文档位于此处. http://james.newtonking.com/json/help /index.html?topic=html/SerializationAttributes.htm
I believe you can use json.NET's property attribute system to correct this, the docs are here. http://james.newtonking.com/json/help/index.html?topic=html/SerializationAttributes.htm
public class ToClass
{
public Data[];
[JsonProperty(PropertyName = "0")]
public zero Zero = new zero();
}
这将使反序列化器将名为0
的json属性与名为Zero
This will make it so the deserializer equates the json property named 0
with the C# property named Zero