newtonsoft json序列化程序无缘无故删除'ID'并添加$ id

时间:2019-05-10 14:40:35

标签: .net serialization

行实体,其列ID的值435345序列化为json字符串,并且不包含ID,而是'$ id',且值为1

我该如何解决?(。net Framework 4.6.1)

var jsonString = JsonConvert.SerializeObject(item, new JsonSerializerSettings {
                ReferenceLoopHandling = ReferenceLoopHandling.Serialize,
                PreserveReferencesHandling = PreserveReferencesHandling.None,
                TypeNameHandling = TypeNameHandling.All
            });

0 个答案:

没有答案