调试loadwith在domainservice中有子节点,但在viewmodel中调用时没有子节点
我正在尝试使用 .LoadWith 方法,
我的域服务中有这些代码行:
public IEnumerable<Subject> GetSubjectList(Guid userid)
{
DataLoadOptions loadopts = new DataLoadOptions();
loadopts.LoadWith<Subject>(s => s.Notes);
this.DataContext.LoadOptions = loadopts;
return this.DataContext.Subjects;
}
我可以看到加载主题列表的调试,并且作为列表的 subjects.Notes 属性也填充了子项,但是当我这样做时,
ctx.Load(ctx.GetSubjectListQuery(WebContext.Current.User.UserId), lo =>
{
serverdata = ctx.Subjects;
}, null);
我只得到加载到服务器数据中的主题的平面列表,并且没有注释子项加载到 subject.notes
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有将 [Include] 添加到我的域服务的元数据属性中。
I had not added [Include] to my metadata properties of my domainservice.