Is there simple way transform one object in another, first defined in application object model and another defined in web service refference. Definitions of two objects are the same.
Is there simple way transform one object in another, first defined in application object
Share
If you are using WCF, you can actually share types defined in a WCF service with clients of that service.
See the section Using the Employee Class on the Client of this article:
http://10rem.net/blog/2009/07/13/sharing-entities-between-wcf-and-silverlight
Types defined in your web service become available to (.NET) clients consuming them by electing to reuse types defined on the WCF side.
UPDATE:
As promised in one of my comments, here’s code to create a copy of an object using serialization. I’m including both a variant that expects a specific class, and a variant that uses generics to support any serializable type. You can replace DataContractSerializer with BinarySerializer in many cases.