XML Serialization and Casted objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Moshe Plotkin

    XML Serialization and Casted objects

    B"H

    If XMLSerializer does not store the Class info. then can it store info for an object thats been casted down a level?


    i.e.

    class Address
    {
    public string street;
    }

    class Person
    {
    public string Name;
    public object Location;

    public Person()
    {
    Name = "Me";
    Address ad = new Address();
    ad.street = "somewhere" ;
    Location = ad;
    }
    }

    Can Person be serialized? or will location being an object mess that up?

    Thanks
Working...