codaxy / xsd2

Improved version of xsd.exe
MIT License
34 stars 21 forks source link

/nullable results in element names with underscore prefix #16

Closed pieteckhart closed 2 years ago

pieteckhart commented 2 years ago

(using NuGet package Codaxy.Xsd2 -Version 0.10.0)

The property that is used during serialization is missing an XmlElement attribute that specifies the name:

        /// <remarks/>
        [System.Xml.Serialization.XmlElementAttribute(DataType="date")]
        [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
        public System.DateTime _SomeDate
        {
            get
            {
                return this.someDateField;
            }
            set
            {
                this.someDateField = value;
            }
        }

Resulting XML: <alias:_SomeDate>1985-10-26</alias:_SomeDate>

I will take a swing at the code myself en will create a PR if I succeed.

EDIT: Fixed :)