以下是Country和State命名的两个表,我只是想知道 下面使用C#或Vb.Net对Lambda Expression中的Entity Framework进行SQL查询。
SELECT dbo.Country.CountryID, dbo.Country.CountryName, dbo.State.StateName
FROM dbo.Country
INNER JOIN dbo.State ON dbo.Country.CountryID = dbo.State.CountryID
答案 0 :(得分:3)
from p in context.country
join q in context.state on p.CountryID == q.CountryID
select new { p.CountryID,p.CountryName,q.StateName }