//请各位大虾帮帮忙弄了我好多天了 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();
添加回答
举报
0/150
提交
取消