我正在尝试将{"fileNumber": "1"}
JSON反序列化为以下对象。
CustmObj jFile = JsonConvert.DeserializeObject<CustmObj>(json)objects.
public class CustmObj
{
[JsonProperty("fileNumber")]
public uint FileNumber { get; set; }
}
字符串
我希望它能自动将int转换为string,但它一直抛出错误"Error converting value .. to type 'System.UInt32'. Path ..."
我该怎么做?
1条答案
按热度按时间pod7payv1#
我正在尝试将{“fileNumber”:“1”} json反序列化为以下对象。
只需删除integer:{“fileNumber”:1}的“