S
swiftalpha
Aloha,
Smallish problem: I know how to serialize objects and all, but this
has me worried:
Asume this class. Person is a nice simple object.
[Serializable()]
public class PersonList : List<Person>
{
public PersonList()
{}
private int id;
public int ID
{
get { return id; }
set { id = value; }
}
}
If I serialize this class to XML I get a nice ListOfPerson in my xml,
but the PersonList.ID property is nowhere in the xml. Here's the core
of the serialize:
XmlSerializer serializer = new XmlSerializer(inputObject.GetType());
serializer.Serialize(xmlWriter, inputObject);
Anyone?
-Edoode
Smallish problem: I know how to serialize objects and all, but this
has me worried:
Asume this class. Person is a nice simple object.
[Serializable()]
public class PersonList : List<Person>
{
public PersonList()
{}
private int id;
public int ID
{
get { return id; }
set { id = value; }
}
}
If I serialize this class to XML I get a nice ListOfPerson in my xml,
but the PersonList.ID property is nowhere in the xml. Here's the core
of the serialize:
XmlSerializer serializer = new XmlSerializer(inputObject.GetType());
serializer.Serialize(xmlWriter, inputObject);
Anyone?
-Edoode