日期:2014-05-20  浏览次数:21019 次

LINQ 多表查询的返回值类型问题????
[code=C#][/code]
public List<object> GetStudentInfoClassByAll()
  {
  var list = from s in db.StudentInfo
  join c in db.Class
  on s.BJID equals c.BJID
  select s;
  return list.ToList();
  }
会报错..
请大侠们给我指点...

------解决方案--------------------
var p=from a in db.StudentInfo 
join b in db.Class 
on a.BJID equals c.BJID
select a; 

var temp = p1.Union(p2);
var result = from a in temp from b in temp where a.name == b.name select a;



------解决方案--------------------
探讨
引用:
var p=from a in db.StudentInfo
      join b in db.Class
      on a.BJID equals c.BJID
      select a;

var temp = p1.Union(p2);
var result = from a in temp from b in temp where a.name == b.name select a;



想问的是怎么定义返回值类型?