Data Objects and WCF

Nate Bross

Contributor
Joined
Apr 6, 2005
Messages
601
Location
Chicago, IL
Do you mark your Data Objects with [DataContract] and its fields with [DataMember] in the event that you would ever want to use it in a WCF Service?

I used to mark my Data Objects as [Serializable] and since it was only one tag per class I didn't mind doing it since frequently I would want to serialize the object for storage, and it let me use it in asmx services as well.

Adding all of this WCF specific stuff seems like alot of work for the off chance you may end up using it down the road, but if you don't do it initially and need to use it in a WCF service later you don't have any options except to change and recompile, am I wrong?
 
Last edited:
Back
Top