I have such a contract:
[DataContract] [KnownType(typeof(Person))] public class Gadget { [DataMember] public int Id { get; set; } [DataMember] public string Name { get; set; } [DataMember] public IPerson Person { get; set; } } It represents a gadget that belongs to a person. I just came up with this simple example, it's not important whether it makes sense or not.
So, instead of returning the Person class, I return the IPerson interface. Now the client can no longer generate a strong typed object, but will generate this:
public object Person { get; set; } Now my question is: is it possible to let the client also generate the IPerson interface? It should have enough information, because it can only instantiate Person (only known type).