Linq to SQL with WCF
I worked in a task where I need to use linq to sql and WCF. In order to decorate linq to sql classes with WCF attributes, you need to set the “Serialization Mode’ to Unidirectional. This is a property of dbml file.
Once the property is set to Unidirectional, the classes created will have the WCF attributes (DataContract, DataMember) as shown below,
If you create custom classes, you need to add the WCF attributes manually, otherwise .NET will create for you automatically.
No comments yet.