The worlds variable only contains 1 World object, properly populated (including the user object). Where, I should be getting back a worlds variable with 10 World objects having the user populated for each. If I throw this query into a webbrowser the xml
returned is correct (ie. 10 Worlds each with the user field expanded) so I believe it is a problem with the Microsoft.Data.WebClient.
I was just wondering if this is a known issue or if I am missing something?
michael_db
0 Points
1 Post
eager loading problem
Apr 01, 2008 12:44 AM|LINK
Hi,
I seem to be having a bit of a problem with eager loading. If I do this:
WebDataContext ctx = new WebDataContext("http://blah/DataService.svc");WebDataQuery<World> worlds = ctx.CreateQuery<World>("/world");
foreach (World w in worlds){
MessageBox.Show(w.user.name);}
The worlds variable contains 10 World objects all properly populated. Perfect! However, if I do this:
WebDataContext ctx = new WebDataContext("http://blah/DataService.svc");WebDataQuery<World> worlds = ctx.CreateQuery<World>("/world?$expand=user");
foreach (World w in worlds){
MessageBox.Show(w.user.name);}
The worlds variable only contains 1 World object, properly populated (including the user object). Where, I should be getting back a worlds variable with 10 World objects having the user populated for each. If I throw this query into a webbrowser the xml returned is correct (ie. 10 Worlds each with the user field expanded) so I believe it is a problem with the Microsoft.Data.WebClient.
I was just wondering if this is a known issue or if I am missing something?
Thanks,
Michael Del Borrello