在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();};

我不知道如何解决这个问题。(帮助!

你需要确保Section在你的DomainService中有[Include]指令。元数据文件。

最新更新