select * from ccccc as c where c.A in(select b.A from bbbbb as b where b.C = 'fghfg')
转换成lambda
网上找了一下 但是没有成功的实现.
db.ccccc.AsQueryable().Join(db.bbbbb.AsQueryable(), a => a.A, b => b.A, (a, b) => new { a = b }).Where(c => c.a.C== str);
var ids= bbbbb.where(o=>o.c="fghfg").select(o=>o.a).toarray();
var test= ccccc.where(o=>ids.contains(o.A))
select * from ccccc as c where c.A in(select b.A from bbbbb as b where b.C = 'fghfg')
试试
db.ccccc.Where(a=>db.bbbbb.Where(x=>x.C=="fghfg").Select(x=>x.A).Contains(a.A))