Can't access Linq2Sql DataContracts on client side RRS feed

  • Question

  • Hey,

    I'm using Linq2Sql in my WCF web service with DataContext Serialization mode "Unidirectional". Here I get an auto-generated DataContracts of all my tables in the database with each member as DataMemberAttribute. All seems fine on the service end, but I can't access all the DataContracts on the client side (after adding the service reference). To mark all the columns as DataMemberAttribute, I've given the the Child property of each relationship of the Linq2Sql datacontext.dbml file "False" value.


    I get the "master" tables as DataContracts in the client reference.vb, but the "map" tables and other master tables that use a foreign key reference of other tables are not to be found in the client side service reference.vb file.


    Please help!

    Thursday, December 8, 2011 5:30 AM


  • Ok, I got where the problem was... with the Serialization mode being "Unidirectional", the service only exposes the tables as DataContracts which are provided as a return value to some OperationContract. So I need to optimize my OperationContracts so that they expose the tables as DataContracts to the clients where I can access them!
    • Marked as answer by dhrumilap Thursday, December 8, 2011 6:16 AM
    Thursday, December 8, 2011 6:16 AM