有谁知道如何转换以下内容"选择"进入lambda表达式?
SELECT * FROM table1 WHERE OID IN (SELECT OIDPhone FROM table2 WHERE city = 'New York')
答案 0 :(得分:2)
你可以这样做:
var subQuery = db.OIDPhone.Where(r=> r.City == "New York").Select(r=> r.OIDPhone);
var finalQuery = db.Table1.Where(r=> subQuery.Contains(r.OID));