nHibernate 3 QueryOver 与复合 from 子句
有谁知道一种使用 nHibernate 3 QueryOver 语法进行复合 from 子句的方法 - 这可以通过 Linq to object 实现。我知道 Linq To nHibernate 可以实现这一点,但我仍在尝试了解 queryover api。
下面是从 msdn 获取 Linq to object 的示例:
var scoreQuery = from student in students
from score in student.Scores
where score > 90
select new { Last = student.LastName, score };
取自 MSDN
Does anybody know a way to do compound from clauses - that are possible with Linq to objects - with nHibernate 3 QueryOver syntax. I know its possible with Linq To nHibernate, but I'm still trying to get my head around the queryover apis.
Here is the example taken from the msdn for Linq to objects:
var scoreQuery = from student in students
from score in student.Scores
where score > 90
select new { Last = student.LastName, score };
Taken from MSDN
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 QueryOver API 加入,但我认为您需要使用 Linq to Objects 将结果展平为匿名类型。
像这样的事情:
You can join using the QueryOver API, but I think you'll need to use Linq to Objects to flatten your result into the anonymous type.
Something like this: