我試圖完成下面的查詢(請注意.StartsWith):LINQ的NHibernate的:對多個屬性.StartsWith
return (from p in _session.Linq<Profile>()
where (p.Firstname + " " + p.Lastname).StartsWith(wildcard)
select p).ToList();
此拋出:無法解析屬性:Firstname.Lastname。
如果我這樣做:
return (from p in _session.Linq<Profile>()
where p.Firstname.StartsWith(wildcard)
select p).ToList();
一切工作。怎麼會這樣?
在此先感謝!
我更新了 - 什麼是你想怎麼辦?選擇名稱以某種東西開頭的所有'Profile'? – 2009-10-18 15:13:10
我試圖選擇名字和姓氏(concat'ed)等於通配符的所有配置文件。 – jhovgaard 2009-10-18 16:00:41
你的意思是平等嗎? – 2009-10-18 19:57:28