Silverlight应用程序中客户端和域服务类的查询结果不同

发布于 2024-12-16 15:35:51 字数 1092 浏览 2 评论 0原文

我有一个查询,它带来了一个对象的整个图表:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

纵性 2024-12-23 15:35:51

您需要确保您的 DomainService.Metadata 文件中的部分具有 [Ininclude] 指令。

You need to make sure Section has the [Include] directive in your DomainService.Metadata File.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文