Multiple level inheritance in WCF in C# -


i have 3 classes:

[datacontract] [knowntype(typeof(b))] [knowntype(typeof(c))] public class {    [datamember]    public string value { get; set; } }  [datacontract] public class b : {    [datamember]    public string othervalue { get; set; } }  [datacontract] public class c : b {    [datamember]    public string anothervalue { get; set; } } 

when i'm trying create class c , send using wcf, complains:

element 'http://tempuri.org/:b' contains data type maps name 'http://schemas.datacontract.org/2004/07/c'. deserializer has no knowledge of type maps name. consider using datacontractresolver or add type corresponding 'c' list of known types - example, using knowntypeattribute attribute or adding list of known types passed datacontractserializer.'.

did put knowntype attribute in wrong place? or cant create such classes?

when create class b, work.

thanks


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -