I have my WCF service returning data both in XML and JSON format.
One functios has to return a List, because I don\'t know which class will be used to fill this list
You could define
[KnownType(typeof(MyChildObject0))]
...
[KnownType(typeof(MyChildObjectM))]
public class MyBaseObject { ... }
public class MyChildObject0 : MyBaseObject { ... }
...
public class MyChildObjectM : MyBaseObject { ... }
Or you could add the attribute only once and define static method that returns all M+1 types at once.
and modify:
public class WrapHome
{
...
public List CHART { get;set; }
}