How do i automatically serialize classes that are generated by the mapping of LINQ to SQL? I need to use these objects in WCF.
.NET 3.5 SP1.
How do i automatically serialize classes that are generated by the mapping of LINQ to SQL? I need to use these objects in WCF.
.NET 3.5 SP1.
Short of using the CodeDOM to generate the classes and compile them, this is impossible. Create DTO's for the transfer. This will make your types strong and whoever is maintaining this code will thank you.
On the designer surface, click on the background (i.e. not on any specific entity), and change the "Serialization Mode" to "Unidirectional". That should add the necessary [DataContract]
/ [DataMember]
attributes to the whole model, enabling WCF.