在一个查询中获取分层数据 [英] Fetching Hierarchical Data in One Query

查看:80
本文介绍了在一个查询中获取分层数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨大家好,

有没有办法在一个大型分层查询中从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

解决方案

尝试展开(" Orders / Order_Details")



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

解决方案

Try Expand("Orders/Order_Details")

 


这篇关于在一个查询中获取分层数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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