In WCF, can data contract classes inherit from one another?
问题 In a WCF service, I have two classes with the [DataContract] attribute. One of these classes has an "is-a" relationship with the other - so class B can inherit from class A. However, when I configure inheritance between these two classes, both denoted with a [DataContract] attribute, the metadata fails to load when testing the services. Is this possible in WCF? Am I missing another attribute? [DataContract] public class A { [DataMember] public MyCustomType AValue1{ get; set; } [DataMember]