Let's say I have Category > SubCategory > SubSubCategory > Item set up in my EF entities.
What is the best way to get Category, Subcategory, SubSubCategory and Item where Item.Property = x all in one single request to the server using WCF RIA Services?
With .Include I can only get the children of the entity, not grandchildren and further down ( or up depending on how you look at it).
Furthermore, if I do this...
public IQueryable<ToolingTreeItem> GetTree(int currentLocationId)
{
var tree = from tc in this.ObjectContext.ToolingCategories
from tg in tc.ToolingGroups
from tt in tg.ToolingTypes
from t in tt.Toolings
where t.CurrentLocationId == currentLocationId
select new ToolingTreeItem { Cat = tc, Group = tg, Type = tt, Tool = t };
return tree;
}
...the method is not available on my context in the client side project, presumably because my custom entity class ToolingTreeItem is not recognized somewhere in the mysteries of the deep chasm that is WCF RIA Services.
If it isn't obvious by now, all I want to do is populate my TreeView with Category > SubCategory > SubSubCategory > Item in a single call to the server. What is the best approach?
Many happy returns!