debugging loadwith has subnodes in domainservice, but not when called in viewmodel

Posted by Jakob on Stack Overflow See other posts from Stack Overflow or by Jakob
Published on 2010-06-14T18:12:03Z Indexed on 2010/06/14 23:02 UTC
Read the original article Hit count: 353

Filed under:
|
|

Hi, I'm trying to use the .LoadWith method

I have these lines of code in my domainservice:

public IEnumerable<Subject> GetSubjectList(Guid userid)
        {
            DataLoadOptions loadopts = new DataLoadOptions();
            loadopts.LoadWith<Subject>(s => s.Notes);
            this.DataContext.LoadOptions = loadopts;
            return this.DataContext.Subjects;
        }

I can see debugging that a list of subjects get loaded, and that the Subjects.Notes property which is a List is also populated with subitems, but when I do

ctx.Load(ctx.GetSubjectListQuery(WebContext.Current.User.UserId), lo => 
                {
                    serverdata = ctx.Subjects; 
                }, null);

I only get a flat list of subjects loaded into serverdata, and no note subitems are loaded to subject.notes

© Stack Overflow or respective owner

Related posts about c#

Related posts about Silverlight