开发者

Prevent Shadowed Property From Getting Serialized

开发者 https://www.devze.com 2023-02-23 01:57 出处:网络
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 t

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

精彩评论

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

关注公众号