实体框架选择与基于Concat的内部查询不同

时间:2017-03-21 20:16:07

标签: c# .net entity-framework

concat有效,但外部不同的查询不起作用。错误是'字符串不包含'role_name'的定义...任何想法如何使这个工作?

(from results in ((from pmr in dbContext.project_member_role
                   join r in dbContext.role on pmr.project_member_role_id equals r.role_id
                   where pmr.member_id == memberId
                   select r.role_name)
                   .Concat(from m in dbContext.member
                           join r in dbContext.role on m.portal_role_id equals r.role_id
                           where m.member_id == memberId
                           select r.role_name))
 select results.role_name).Distinct().ToList();

0 个答案:

没有答案