Silverlight应用程序中客户端和域服务类的查询结果不同
我有一个查询,它带来了一个对象的整个图表:
IQueryable<Rapport> rap = this.ObjectContext.Rapport.Include("Filtre")
.Include("Filtre.FiltreValeur")
.Include("Tri")
.Include("Section")
.Include("Section.ChampTexte")
.Include("Section.ChampTexte.MiseEnForme")
.Include("Section.Attribut")
.Include("Section.Attribut.MiseEnForme")
.Where(r => r.PK_Rapport == PK_Rapport);
变量 rap 的内容已按请求加载。我的问题是,加载查询时,节点“Section”是空的,知道它在域服务级别已满。 我加载查询如下:
EntityQuery<Rapport> query = _context.GetRapportCompletByIDQuery(_rapport.PK_Rapport);
_context.Load(query).Completed += (sender1, args1) =>
{
this._RapportComplet = ((LoadOperation<Rapport>)sender1).Entities.AsQueryable<Rapport>().First();};
我不知道如何解决这个问题。 :( 帮助!
I have a query that brings the whole graph of an object:
IQueryable<Rapport> rap = this.ObjectContext.Rapport.Include("Filtre")
.Include("Filtre.FiltreValeur")
.Include("Tri")
.Include("Section")
.Include("Section.ChampTexte")
.Include("Section.ChampTexte.MiseEnForme")
.Include("Section.Attribut")
.Include("Section.Attribut.MiseEnForme")
.Where(r => r.PK_Rapport == PK_Rapport);
The content of the variable rap is loaded as requested. My problem is that when loading the query, the node "Section" is empty, knowing that it's full at the domain service level.
I load the query as following:
EntityQuery<Rapport> query = _context.GetRapportCompletByIDQuery(_rapport.PK_Rapport);
_context.Load(query).Completed += (sender1, args1) =>
{
this._RapportComplet = ((LoadOperation<Rapport>)sender1).Entities.AsQueryable<Rapport>().First();};
I have no clew how to resolve this. :( HELP!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要确保您的 DomainService.Metadata 文件中的部分具有 [Ininclude] 指令。
You need to make sure Section has the [Include] directive in your DomainService.Metadata File.