查找表中出现的所有不同的人,负责创建连接的责任实体负责更多或更多人员和实体项目?实体到SQl,linq到sql查询
如何转换SQL查询在那里的技术? SQL查询是
select distinct p.PersonID,p.FirstName,p.LastName
from Responsible tr inner join People p on p.PersonID=tr.People_PersonID;
我attemot是
string query = @"SELECT value empl
FROM TicketBaseEntities.Responsible AS tr
INNER JOIN TicketBaseEntities.People AS empl
on empl.PersonID =tr.Responsibles.People_PersonID where tr.Responsibles !=null";
return Context.CreateQuery<Employee>(query).Distinct();
错误信息是:
'People_PersonID' 不是Transient.collection [TicketBaseModel.Person(可为空=真的”的成员,默认值=)]”。要提取集合元素的属性,请使用子查询遍历集合。近简单的标识符,第5行,列63
?你能展示你的进展吗? – 2012-07-10 12:11:49
我试过的是sql查询....我是初学者在实体或linq – 2012-07-10 12:17:40
为什么你使用实体sql而不是linq? – 2012-07-11 14:53:46