命名空间:using System.Data.Objects;
var query = db.TxtRes.Join(db.LangRes, a => new { id1 = a.ResID, id2 = a.ResID }, b => new { id1=b.ID,id2=b.ID }, (a, b) => new { a.ID, a.ResID, a.Lang, b.Key });
var objectQuery = query as System.Data.Objects.ObjectQuery;
return objectQuery.ToTraceString(); //获取sql语句