首页新闻找找看学习计划

求助求助 大虾们 EF遇到问题了.指导啊

0
悬赏园豆:200 [已关闭问题] 关闭于 2012-10-27 11:12
1   var mySet = (from e in dbset.AsNoTracking().Where(specification.SatisfiedBy())
2                          join m in base.DataContext.CorpShop on e.CSID equals m.CSID//门店
3                          join o in base.DataContext.CorpSalesOrderProductDetail on e.OrderNo equals o.OrderNo//商品
4                          join p in base.DataContext.CorpSalesOrderECHolder on e.OrderNo equals p.IDCardNo//接收人
5 
6                          select new { e.AccountName, e.AccountTel, e.Receivables, e.ActualReceive, e.PostTime, e.OrderStateEF, e.PayTime, e.PayTypeEF, e.UpdateTime, e.OrderCreateTypeEF, e.ClosingStateEF, e.Taobao_OrderNo, e.Taobao_OrderStateEF, e.OrderNo, e.CUNickName, m.ThirdShopTypeEF}
7                              ).ToList().Select(x => new OrderSearchDTO() { AccountName = x.AccountName, AccountTel = x.AccountTel, ActualReceive = x.ActualReceive, PostTime = x.PostTime, OrderState = (OrderState)x.OrderStateEF, PayTime = x.PayTime, PayType = (PayType)x.PayTypeEF, UpdateTime = x.UpdateTime, OrderCreateType = (OrderCreateType)x.OrderCreateTypeEF, ClosingState = (ClosingState)x.ClosingStateEF, Taobao_OrderNo = x.Taobao_OrderNo, Taobao_OrderState = (TaobaoTradeState)x.Taobao_OrderStateEF, OrderNo = x.OrderNo, CUNickName = x.CUNickName, Receivables = x.Receivables, ThirdShopType = (ThirdShopType)x.ThirdShopTypeEF});

描述:我现在是读取订单表的数据 上面条件最后两个是一个订单有多条数据的外键关系 现在问题来了 在Select new 的时候 我要怎么得到商品 和 接收人的List数据    有不清楚的请告诉我

sprintf的主页 sprintf | 初学一级 | 园豆:60
提问于:2012-10-25 17:37
< >
分享
所有回答(2)
0

看着有点晕。

jerry-Tom | 园豆:4077 (老鸟四级) | 2012-10-25 18:20
0

你商品定义的别名是o   接受人表的别名是p

在Select New 里面 写o.XXXX,p.XXX就可以啊。不知道你是不是这个意思。 

sym_cn | 园豆:798 (小虾三级) | 2012-10-26 10:07
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册