Shared data objects between WCF services and Silverlight applications

I have a custom data entity (data object) exposed through a WCF web service. The WCF service exists in a web application. Then, I have a Silverlight application that contains The service reference of the WCF service. When I add the service reference, a proxy will be generated, and the proxy includes the version of the custom data entity.

How should I structure my code so that Where to declare the data entity and share it between the project containing the WCF service and any Silverlight application that references it? I want to eliminate the version of the data entity generated by the proxy.

There is a good example how to do this here by Pete Brown. Using this method, you can use the same class in the Silverlight client and WCF service without using the generated object.

I have one through WCF A custom data entity (data object) exposed by the web service. The WCF service exists in the web application. Then, I have a Silverlight application that contains a service reference to that WCF service. When I add the service reference, it will be generated Proxy, and the proxy includes a version of the custom data entity.

How should I structure my code to declare the data entity in one place, and in the project containing the WCF service and the reference to it Sharing between any Silverlight applications? I want to eliminate the version of the data entity generated using the proxy.

There is a good example how to do this here by Pete Brown. Using this method, You can use the same class in Silverlight client and WCF service without using generated objects.

Leave a Comment

Your email address will not be published.