eager loading problem

Rate It (1)

Last post 04-29-2008 2:24 PM by OlegKap. 1 replies.

Sort Posts:

  • eager loading problem

    03-31-2008, 8:44 PM
    • Loading...
    • michael_db
    • Joined on 04-01-2008, 12:23 AM
    • Posts 1

    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

     

  • Re: eager loading problem

    04-29-2008, 2:24 PM
    • Loading...
    • OlegKap
    • Joined on 06-07-2005, 1:38 PM
    • Cary,NC
    • Posts 1

    I have the same issue and also think its Microsoft.Data.WebClient who has a problem.

    Did you find a work around this issue or have it confirmed as a bug?

     Thanks,

    Oleg
     

Page 1 of 1 (2 items)