本文介绍了在一个查询中获取分层数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨大家好,
有没有办法在一个大型分层查询中从EF获取所有链接对象?例如,如果我想获得所有客户的订单和所有这些order_details,我会使用什么查询?
我尝试过以下但它不喜欢第二次展开。
Dim query = from c in svcContext.Customers.Expand(" Orders")。展开("Order_Details")_
其中c.CustomerID = cust.CustomerID
感谢您的任何想法!
Ken
作者:ASP .NET 3.5 For Dummies
解决方案
Hi folks,
Is there a way to get all linked objects from EF in one large hierarchical query? For example, if I want to get all of a customer's orders and all of those order_details, what query would I use?
I've tried the following but it doesn't like the second Expand.
Dim query = From c In svcContext.Customers.Expand("Orders").Expand("Order_Details") _
Where c.CustomerID = cust.CustomerID
Thanks for any ideas!
Ken
Author: ASP.NET 3.5 For Dummies
解决方案
这篇关于在一个查询中获取分层数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!