如何使用LINQ从两个表中编写条件查询

时间:2011-05-18 15:13:32

标签: linq

两个数据库中有两个表 促销:代码,来源,经纪人 BrokerNo:Id,Name,BrokerNo 我要查询的是所有BrokerNo.Name记录满足Promotion.broker = BrokerNo.BrokerNo和Promotion.source =“asdf”的条件 如何使用LINQ编写查询语句?

1 个答案:

答案 0 :(得分:1)

from promotion in Promotion
from brokerNo in BrokerNo
where promotion.source == "asdf" && promotion.broker == brokerNo.BrokerNo
select brokerNo.Name