NullProperty Sample

Back to summary

Source

using System.ComponentModel;

namespace XmlSerializersTest.Samples
{
    [Title("Null property")]
    public class NullProperty
    {
        public string NullString { get; set; }

        [DefaultValue(null)]
        public string NullStringWithDefault { get; set; }

        public MyClass CustomClassProperty { get; set; }
    }

    public class MyClass
    {
        public int SomeProperty { get; set; }
    }
}

Standard Serializer

<NullProperty />