Is there a weaver for WCF that auto implements the DataContract and DataMember attribute to my entity class?
We are migrating the local back-end of our system to a WCF Service. We have too many entity class and it will really take an awful lot of time to add that attribute in each of our entity class.
Please refer to this link for reference of a weaver, It is for INotifyPropertyChange for WPF and it really does help.
My code is in C#, framework 4.0, build in Visual Studio 2010 Pro.
Any help will be greatly appreciated.
Thanks in advance.
Depending on what technology you use, you may decide not to directly expose your entity classes. For instance, it’s not a good idea to expose Entity Framework entities, as this will also serialize the base classes, which you probably don’t want.
I recommend you try serializing one of your entities, then look at the resulting client code to see if anything undesirable comes across the wire.
If there is a problem, then you may want to design Data Transfer Objects to correspond to each of your entities. This might be done using code generation, so you don’t have to do it all by hand.