I’m trying to write a generic wrapper to serialize a list of generic objects to an xml file, which all works fine except the elements are taking the name of the base class instead of the inherited class names.. Is there a way to make it show the name of the inherited class?
For example..
public class ObjectList
{
[XmlElement("I want my inherited class here but it shows the base class object")]
public List<Base> Items
{
get { return items; }
}
}
public class Inherited : Base
{
}
Turns out the only way to do this was to set overrides