开发者

What is the purpose of the PropertySpecified pattern used by XML Serialization?

开发者 https://www.devze.com 2022-12-22 16:34 出处:网络
What is the purpose of the PropertySpecified pattern used by XML Serialization ? What problem doe开发者_开发技巧s it tryto solve ?It tries to solve the problem that int float and so on cannot be null,

What is the purpose of the PropertySpecified pattern used by XML Serialization ?

What problem doe开发者_开发技巧s it tryto solve ?


It tries to solve the problem that int float and so on cannot be null, so it has no other way to signal whether the attribute/element exists in the XML file or not.

It was really only useful in .NET 1.x, since in .NET 2 you can just use Nullable<T> (e.g. int?) instead.

0

精彩评论

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