I have the following xml file:
<ArrayOfX xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<X>
<Name>Name1</Name>
<ArrayOfY>
<Y>
<Member1>1</Member1>
</Y>
...
</ArrayOfY>
</X>
...
</ArrayOfX>
public class X {
public string Name { get; set; }
public List<Y> Y { get; set; }
}
public class Y {
public String Member1 { get; set; }
}
But if i try to deserialize with XmlSerializer, Name contains the correct value but the Y list is empty. Any idea?
XmlSerializer serializer = new XmlSerializer( typeof( List<X> ) );
return (List<X>)serializer.Deserialize(reader);