'Specified' for Nullable fields in new

Jan 8, 2014 at 10:43 AM
Edited Jan 8, 2014 at 11:30 AM
In the case of optional/nullable elements, Xsd2Code generates corresponding "..Specified"-fields. However, these fields have to be manually assigned true if the underlying field has a nun-null value, in order for the value to be serialized. Wouldn't it be much easier to resolve automatically?
        [System.Xml.Serialization.XmlIgnoreAttribute()]
        public bool SomethingSpecified {
            get {
                return something.HasValue;
            }
            set {
                if (!value) {
                    something= null;
                }
            }
        }