I have a WCF service and have to expose an interface as datacontract. There are two derived classes from the interface.
The WCF service will return an object of the derived type.The client will have to cast it as a derived class. Is that possible on the client side ?.What should be my approach.
I have a WCF service and have to expose an interface as datacontract. There
Share
If you have derived classes, you need to “advertise” those on the data contract:
or you can also specify these kind of relations on a service contract:
Check out the MSDN docs on Data Contract Known Types or Service Known Types for more background info.