I have previously written a post about including properties in WCF RIA Services. The post was using POCO as business model. If you use LINQ-to-SQL as your business model you might need some extra load options to get your associated properties sent from the server to the client.
You can add the extra load options in the domain service methods on the server. In my previous post I use two entities; a Company and an Employee entity. The Company entity has a Employee property called CEO.
First you need to add a reference to System.Data.Linq and add a using in the BusinessService.
Second you need to add the load options. In this case you want CEO to be loaded when the Company is loaded.
Finally you set the load options to the DataContext and then you’re ready to return your data as normal.
(In the code above I get an error on the DataContext; don’t mind that – it’s just because I used the sample code from the previous post that don’t use LINQ-to-SQL and there don’t recognize the DataContext object.)
by xamlgeek