开发者

Prevent Shadowed Property From Getting Serialized

This is kind of piggybacking off of this question: A开发者_Python百科SP.NET: Shadowing Issues

I've discovered that the issue isn't actually that the property isn't getting serialized, it is, but that BOTH the shadowed and shadowing properties are getting serialized, and since the shadowed property is being serialized second, its value is the one that is available via JSON to my Javascript. My serialization code looks like this.

How can I ensure that my shadowed property does not get serialized, while still making that property available for serialization when that actual object (the base type object) needs to be serialized? Or at the VERY least, switch the order the properties are serialized so the correct one overrides the incorrect one?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜