0
votes

I am getting started with WCF Data Services. A WCF Service requires programmer to explicitly define the DataContract and the DataMembers comprising the DataContract but I don't see any such thing for WCF Data Services. Given a class, how to choose what properties get serialized when using WCF Data Services?

When I try to create a WCF Data Service for my SQL Server database, I get an error - it does not know how to serialize objects of type DbGeometry.

1

1 Answers

0
votes

Don't be fooled by the name WCF - WCF Data Services is more about OData than traditional WCF, so you don't need to think about data you expose in terms of DataContact/DataMember. If you expose the content of the SQL database, use Entity Framework provider that will hide the data wiring internals. Otherwise you will need to use either Reflection or Custom provider which is more work (search for samples).