linq语句include和union
from c in _entities.A
.Include("B_list")
where c.id==id
select c).FirstOrDefault();
B_list 又跟其他表union
该怎么写语句呢?
------解决方案--------------------var q = ( from c in _entities.A
.Include("B_list")
where c.id==id
select c ).Union( from e in db.Employees select e.Country );
------解决方案--------------------楼上的,我的意思是实体A include几张表,有张表是B_list, 我希望的是表B_list 又跟其他表union
按照思路应该是这样
from c in _entities.A
.Include("B_list").Union( from e in db.Employees select e.Country )
where c.id==id
select c).FirstOrDefault();
------解决方案--------------------有人能解决吗?
------解决方案--------------------已解决,换个思路,2个linq语句写掉,然后合并list