I get a response which contains following:
<carList>
<numberOfRecords>237</numberOfRecords>
<year>1982</year>
<year>1983</year>
<year>1978</year>
<year>1955</year>
<year>1998</year>
</carList>
this is part of bigger xml doc, I can desterilizes the rest but this part I cannot. rest of my desterilized objects comes fine. here is my models:
public class Response
{
[XmlArray( "carList")]
[XmlArrayItem("year")]
//[XmlElement("carList")]
public CarList? CarList { get; set; }
}
public class CarList
{
[XmlElement("numberOfRecords")]
public int? NumberOfRecords { get; set; }
[XmlElement("year")]
public List<string>? Year { get; set; }
}
my deserializer:
XmlDeserializer xmldes = new XmlDeserializer();
var deserializedResponse = xmldes.Deserialize<Response>(response);