我有两个返回IQueryable的方法:
IQueryable<Person> GetGoodPeople();
并且
IQueryable<Person> GetBadPeople();
我需要编写这个查询:
var q = from x in GetGoodPeople()
from y in GetBadPeople()
select new { Good = x, Bad = y };
除非我声明一个变量并在查询中使用它,否则上述代码不受linq to entities支持(会抛出NotSupportedException
异常):
var bad = GetBadPeople()
var q = from x in GetGoodPeople()
from y in bad
select new { Good = x, Bad = y };
有没有一种方法可以直接在Linq to Entities中使用IQueryable方法?