I am in certain type of a dilemma.

Attempting to query my DB via a RIA service from my silverlight client, I went in to the following problem. The aim gets a listing of menus and submenus. (Note: I have only a couple level menus list, so only one primary menu and multiple submenus, but individuals submenus don't/can't contain other submenus ).

First part:

public void LoadMenus(Action<ObservableCollection<Menu>> callback)


                                                        foreach (var m in menus.Where(x => x.Parent == x.MenuID))




                                                    , null)


The loadMenusByParentID non working version:

private IEnumerable<Menu> LoadMenusByParentID(int parentID)


        return m


working version:

private IEnumerable<Menu> LoadMenusByParentID(int parentID)

    amplifier&lifier m.MenuID != parentID)


Attempting to put lower sound practice, I plan to make use of the Load() function (also since it is and async operation). But for whatever reason I am not receiving an effect from this, while after i LinqQuery the context itself I actually do obtain a result.

My Service way of the non working version appears like this:

public IQueryable<Menu> GetMenusByParentID(int parentID)

    amplifier&lifier m.MenuID != parentID)


Anybody has any idea why the bloody factor ain't working?

Large thanks ahead of time! Xox, Tom

Your "load" version doesn't (and can't) wait for a data to become loaded. That Load technique is an async call and also the value came back immediately comes with an empty Organizations collection.

The IEnumerable version returns a lazy loading query rather, therefore it loads the information when used.

I must observe how you're consuming the phone call to LoadMenusByParentID before offering specific advice, but essentially you have to rework the customer to make use of async data (or stay with lazy loading)