//请各位大虾帮帮忙弄了我好多天了
DataContext con = new DataContext();
Survey entity = null;//接收的实体对象
DataLoadOptions dl = new DataLoadOptions();
dl.LoadWith<Survey>(c => c.SurveyAnswers);//关联SurveyAnswers表
con.LoadOptions = dl;
entity = (from su in con.Surveys
//where中我想让SurveyAnswers表的id等于传过来的id
where su.ID == ID //&& SurveyAnswers.ID == AnswerID
select su).SingleOrDefault();
from fist in zdc.tb_Role join jointable in zdc.tb_Login on fist.ID equals jointable.RoleID where 。。。。。select。。。。。。
role表连接login表
可以了吧
在dbml文件里面就可以映射的啊,干什么那么麻烦呢。