There is an element in my XML document that can contain multiple children. In my class, I declare the property as:
[XmlArray("files", IsNullable = true)]
[XmlArrayItem("file", IsNullable = false)]
public List<File> Files { get; set; }
During deserialization, if the item is <files>missing, I want the Files property to be null . However, what happens is that the files are deserialized into an empty List object. How can I prevent this?
source
share