Linq 到实体加入问题

本文关键字:问题 实体 Linq | 更新日期: 2023-09-27 17:57:00

您将如何与Linq to Entities进行这样的连接?

var resultA = client.GetFirstList().ToList();                   
var resultB = client.GetSecondList().ToList();
var d = (from b in resultB
         join a in resultA on b.AnICollection.Select(x => x.TypeId) equals a.TypeId 
select b)

Linq 到实体加入问题

您应该能够像下面这样查询它:

from a in context.Customers
join b in context.Orders
on a.CustomerID equals b.CustomerID
join c in context.AnICollection
on b.TypeID equals c.TypeID
select b