简体   繁体   中英

Linq To Entities Join Issues

How would you make a join like this with 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)

You should be able to query it like the following:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM