If I have the following XML segment:
<Times>
<Time>1/1/1900 12:00 AM</Time>
<Time>1/1/1900 6:00 AM</Time>
</Times>
What should the corresponding property look like that, when deserialization occurs, accepts the above XML into a list of DateTime objects?
This works to deserialize the XML segment to a list of string
objects:
[XmlArray("Times")]
[XmlArrayItem("Time", typeof(string))]
public List<string> Times { get; set; }
But when I use DateTime as the type instead of string (for both the List type and XmlArrayItem type), I get the following error:
The string '1/1/1900 12:00 AM' is not a valid AllXsd value.
Thanks!