且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

DataContractJsonSerializer生成Ghost字符串到JSON密钥?

更新时间:2023-11-15 17:40:40

这只是有根据的猜测.我认为这是因为您使用的是公共字段,而不是名称和用户ID的属性.

This is just an educated guess. I think it's because you're using public fields instead of properties for name and userid.

看来这也与您使用[Serializable]属性而不是[DataContract]和[DataMember]有关.请查看此帖子以获取更多详细信息:

It appears it also has to do with the fact that you are using the [Serializable] attribute instead of [DataContract] and [DataMember]. Check out this post for more detail:

JSON的C#自动属性反序列化