New to WCF and DataContracts RRS feed

  • Question

  • I am building my first major WCF project.  I don't think I fully understand defining DataContracts so I am hoping someone can help me out here.  I know I need to make a DataContract for complex objects (IE Custom Classes).  However This projects design has a LOT of custom classes that are used all over the application.  A great deal of those will be sent and received via the Web Service.

    My question is this, can I define the data contract in the base class assembly and still use it everywhere else without issue?  Or can I define the class in a way in which I don't have to define a DataContract for it.  All the WCF samples are small and put the DataContract right there with the WCF methods.  This would require me to declare and thus maintain them twice if that was the case.  I certainly hope its not.  


    Monday, July 30, 2012 12:34 PM


All replies