XmlCodeExporter and nullable types
问题 System.Xml.Serialization.XmlCodeExporter generates code (in code CodeDom form) from an XSD schema. But it does it with some quirks. For example an optional element: <xs:element name="Something" type="xs:decimal" minOccurs="0" maxOccurs="1"/> I would expect this to generate a corresponding code member of type Nullable<decimal> , but it actually creates a member of type decimal , and then a separate SomethingSpecified field which should be toggled separately to indicate a null value. This is