WCF Data Service Proxy Class
I am pretty sure this is a stupid question, but here goes anyway. I have a WCF Data Service expo开发者_如何学JAVAsing an object, let's say Person. This Person object is in the namespace Domain.Person. I have a client with a proxy to the WCF Data Service. This client has code that works with the referenced Domain.Person class. However, the proxy is returning a different type, Client.Person and it is complaining of being unable to convert between the two.
So, apart from me being stupid (likely), isn't the proxy supposed to return a type of Domain.Person? And if not, should the Client.Person not be the same? Sorry, bit confused.
I have no experience with WCF Data Services, but it seems to me that the proxy generated it's own version of the Domain.Person class and is using this.
When adding a 'normal' wcf service reference, it is possible to specify assemblies from which types can be reused while generating the proxy. That's hidden under the 'Advanced' button on the dialog where you select your WCF service.
If you are sure that this is enabled, I'd try opening up the generated proxy (with show all files you can see the generated .cs file) and comparing the types to your Domain types. If there are any significant differences, add them to your Domain types, remove the service reference and add it again. Wash-rinse-repeat...
Again, my experience with WCF data services is non-existent, so maybe someone has a more to-the-point answer.
精彩评论