您如何渴望加载子对象? [英] How do you Eager Load child objects?

查看:109
本文介绍了您如何渴望加载子对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Server项目中,我有一个Bill.lsml.cs类

In the Server project I have a Bill.lsml.cs class

在该班级中,有一个名为Bill previousBill的班级成员

In that class, there is a class member called Bill previousBill

每个输入和/或更新的新账单都需要与其以前的账单进行比较.

Every new bill that gets entered and/or updated needs to be compared to its previousBill.

在代码中,我试图尽快加载与previousBill相关的所有子对象,包括子对象的子对象. .include()引发不受支持的异常.

In code, I am trying to eagerly load all child objects related to previousBill, including child objects of child objects. .Include() throws an unsupported exception.

您如何在Lightswitch中执行此操作?我知道管理包含的数据"屏幕上的选项,但此对象不在屏幕上,也不需要.

How do you do this in Lightswitch? I'm aware of the "Manage Included Data" options on screen but this object is not on screen and does not need to be.

推荐答案

如果在服务器端进行比较,您需要什么载入?您可以通过导航属性访问linq中的所有子数据.  您可以举一个您想做的事的例子吗?

If you are doing the comparison on the server side, what do you need to load?  You have access to all of the child data in linq via the navigation property.  Can you post an example of what you are trying to do?



这篇关于您如何渴望加载子对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆