I am having an issue exposing my nested object VIA WCF RIA Service.
Example of business objects (not tied to DB)
public class User
{
public string Name { get; set; }
public Product Product { get; set; }
开发者_C百科}
The user object will come to my client object, however the product does not. How can I resolve this?
You can also do it in the query like this:
var MyUsers = DataContext.Users.Include("Product").ToList();
Do you use the [Include] tag in User metadata? It will identify it as information that should be sent over the network.
If there isnt a mapping, use a LINQ query: some pseudocode
var user= from u in User
join Product on User.Key = Product.Key
select u;
[Include]
public Product Product { get; set; }
精彩评论