When planning out my programs, I often start with a chain of thought like so:
A football team is just a list of football players. Therefore, I should
One aspect is missing. Classes that inherit from List<> can't be serialized correctly using XmlSerializer. In that case DataContractSerializer must be used instead, or an own serializing implementation is needed.
public class DemoList : List
{
// using XmlSerializer this properties won't be seralized:
string AnyPropertyInDerivedFromList { get; set; }
}
public class Demo
{
// this properties will be seralized
string AnyPropetyInDemo { get; set; }
}
Further reading: When a class is inherited from List<>, XmlSerializer doesn't serialize other attributes