Is there a way to create a WCF DataContract for a 3rd party type?

I go to wcf and am trying to figure out how I am going to declare my data contracts properly. Some of the types I have removed are from a third party that I cannot change. Are attributes the only way to explicitly declare data contracts in wcf? I am aware of the functionality of autodata contracts in 3.5, but the books I read prevent this from happening. And besides, this method assumes that the entire state is publicly available, which is often not the case.

+2


source to share


1 answer


Do you feel that you are not exposing these third party types at your service level? Just create DTOs for them and draw the path to / from if you need. It seems to me that this is cleaner.



+4


source







All Articles