Linq-to-NHibernate OrderBy 不工作
我正在尝试订购 Linq to NHibernate 查询。
var clients = (from c in session.QueryOver<Clients>()
orderby c.Nom
select c
).List();
它不起作用:List() 不是现有方法。 如果我这样写,它就会起作用:
var clients2 = (from c in session.QueryOver<Clients>()
orderby c.Nom
select c
);
var clients3 = clients2.Asc.List();
是否使用 orderby 是有区别的。 在前面的代码中,clients2 类型是 NHibernate.Criterion.Lambda.IQueryOverOrderBuilder。
var clients4 = (from c in session.QueryOver<Clients>()
select c
);
在本例中,client4 的类型是 NHibernate.Criterion.QueryOver。 有人知道这个问题吗?
I'm trying order a Linq to NHibernate query.
var clients = (from c in session.QueryOver<Clients>()
orderby c.Nom
select c
).List();
It doesn't work : List() isn't an existing method.
It works if I write that :
var clients2 = (from c in session.QueryOver<Clients>()
orderby c.Nom
select c
);
var clients3 = clients2.Asc.List();
There is a difference if orderby is used or not.
In the previous code, the clients2 type is NHibernate.Criterion.Lambda.IQueryOverOrderBuilder.
var clients4 = (from c in session.QueryOver<Clients>()
select c
);
In this case clients4's type is NHibernate.Criterion.QueryOver.
Does someone know this issue ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
QueryOver 不是 LINQ API。您应该改用查询扩展方法。
更新
QueryOver is not the LINQ API. You should use the Query extension method instead.
Update