开发者

RIA Services exposing nested objects

开发者 https://www.devze.com 2023-03-05 01:45 出处:网络
I am having an issue exposing my nested object VIA WCF RIA Service. Example of business objects (not tied to DB)

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; }
0

精彩评论

暂无评论...
验证码 换一张
取 消