Adding WCF service reference adds DataContract types too

Posted by Avi Shilon on Stack Overflow See other posts from Stack Overflow or by Avi Shilon
Published on 2010-03-14T08:40:39Z Indexed on 2010/03/14 8:45 UTC
Read the original article Hit count: 297

Filed under:

Hi everybody,

I've used Visual Studio's Add Service Reference feature to add a service (actually it is a workflow service, created in WF4 RC1, but I don't think this makes any difference), and it also added the DataContracts that the service uses. At first this seemed fine, because All I've had in the DataContracts was simply properties, with no implementations. But now I've added code in the constructor of one data contracts that initializes creates an instance of one of the properties that exposes a list of other DCs, and when I've updated the service reference via VS (2010 RC1), the implementation was not updated.

What should I do? Should I use my DCs instead of the ones created by VS or should I use the ones VS created? I've noticed that the properties in the VS-generated DCs contain some additional logic for checking equality in the setters and they also implement some interfaces too (like IExtensibleDataObject and INotifyPropertyChanged) which might get handy I guess in the future (I'm not knowledgeable at WCF).

Thank you for your time folks, Avi

© Stack Overflow or respective owner

Related posts about wcf