EF实体类 entity = new EF实体类();
var query = (from u in entityt.用户表 join b in entity.权限表 on u.用户权限Id equls b.Id where u.用户Id == 1 select u).FirstOrDefault();
两个表的linq
private DataClasses1DataContext dc;
dc = new DataClasses1DataContext();
var heji = (from da in dc.q1
join du in dc.q2
on da.danhao equals du.danhao
where da.hetong == "XXXX"
select new { du.color1, da.danhao, da.riqi, du.zhongliang, du.beizhu }).Distinct();
from:http://blog.csdn.net/findsafety/article/details/42640691