I have three projects: a UI (web), a WCF service, and a type library (with business objects).
I have included the type library in both the UI and the WCF service.
I have created a service reference to the service from the UI.
When I look at the Object Browser for the service reference in my UI project, it does not have all of the object types in there. I suspect it’s not coincidental that the types it’s missing are the types I have because I included the type library.
My question is this: is my service reference being smart and recognizing that it doesn’t need to create types (in the proxy) for the types that I already have a reference to? Everything is working excellent and I like the behavior so I’m not complaining… just wondering. It’s great having the reference to the actual type library because then all of my getters and setters work even in the consumer (my UI).
Take a look at reference properties. You will find a “Reuse types from referenced assemblies…” switch. Having this turned on means that the proxy generator reuses classes it can access locally, at the client side.