I'm trying to make a class pass through WCF. These are no problems except for my abstract class which isn't serialized. Is there any way to avoid that ?
[DataContract]
[KnownType("GetKnownTypes")]
public class BusinessObject
{
public static Type[] GetKnownTypes()
{
// only returns the different types my "Field" abstract class can take
return Services.WCFRIAKnownTypesHelperService.FieldsKnownTypes.ToArray();
}
[DataMember]
public String ID { get; set; }
[DataMember]
public List<Section> Sections { get; set; }
[DataMember]
public List<Field> Fields { get; set; }
}
And now my field class
[DataContract]
public abstract class Field
{
[DataMember]
public String FieldID { get; set; }
[DataMember]
public String Title { get; set; }
[DataMember]
public Object Content { get;set; }
}
Why isn't it working ?