Representing Null values differently when serializing objects to XML

前端 未结 2 856
深忆病人
深忆病人 2021-01-22 21:50

I am serializing objects to XML like so using the following code:

using System.IO;
using System.Xml.Serialization;

namespace ConsoleApplication2
{
    class Pro         


        
2条回答
  •  醉话见心
    2021-01-22 22:14

    Using

    [XmlElement(IsNullable = true)]
    public string Two { get; set; }
    

    you can represent it as

提交回复
热议问题