public class Contact
{
public string id{ get; set; }
public string contact_type_id { get; set; }
public string value{ get; set; }
public string person_id { get; set; }
public Contact()
{
}
}
public class Contact:Base.Contact
{
public ContactType ContactType { get; set; }
public Person Person {get; set;}
public Contact()
{
ContactType = new ContactType();
Person = new Person();
}
}
和:
Contact c = new Contact();
Base.Contact cb = (Base.Contact)c;
问题:
The **cb** is set to **Contac** and not to **Base.Contact**.
Have any trick to do that????
我只需要实现我的基类,这是我的问题! – JoeLoco 2010-04-13 19:22:58
DataContractJsonSerializer做了深度serealizer,但我只需要Base.Contact的特性。 – JoeLoco 2010-04-13 19:24:47
我需要一个DownCast,但是当我将Cast对象向下投射我的cb时! – JoeLoco 2010-04-13 19:28:13