WCF only serializes data from data contracts β no methods or behavior.
It's by default and by design - after all, WCF is a messaging system - you only transmit serialized messages.
WCF is NOT a "remote procedure" or "object deletion system", and thus, when creating a proxy server, he will make sure that the data signature on the wire is identical (through XML serialization) - and thatβs all .
The only way to achieve what you are looking for is:
- Create a separate assembly of the class library containing classes of service and data contracts.
- refers to the general assembly of contracts from both your server-side service code and your Silverlight client-side application.
- when creating a service link, Visual Studio will now reuse common, shared classes in the assembly and not recreate proxy data classes (and lose methods in the process)
source share