views:

41

answers:

1

I am migrating to wcf and trying to figure out how I'm going to declare my Data Contracts properly. Some of the types I have been remoting are from a third party that I am unable to change. Are attributes the only way to explicitly declare data contracts in wcf? I know about the auto data contract functionality in 3.5, but the books I'm reading discourage that. And besides, that way assumes all state is publically available, which is oftentimes not the case.

+3  A: 

Have you considered not exposing those third party types on your service layer directly then? Just create DTOs for them and map on the way in/out if you need to. Seems cleaner to me.

tomasr