有谁知道为什么 Take() 在这里不起作用

发布于 2024-09-12 14:44:43 字数 246 浏览 1 评论 0原文

我有以下使用 Nhibernate.Linq 的代码,

   var apps = Session.Linq<History>().OrderByDescending(r => r.LastUpdated).Take(50);
   Console.Write(apps.Count());

计数返回 1000(不是我期望的 50)

任何想法为什么 .Take() 不起作用?

i have the following code using Nhibernate.Linq

   var apps = Session.Linq<History>().OrderByDescending(r => r.LastUpdated).Take(50);
   Console.Write(apps.Count());

the count returns 1000 (NOT 50 which is what i would have expected)

any ideas why the .Take() is not working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦言归人 2024-09-19 14:44:43

它看起来像是 Linq 提供程序中的一个错误(您正在使用旧的提供程序,我也尝试了新的提供程序,但它仍然不起作用)。

您应该在 http://jira.nhforge.org/ 中提出问题

作为解决方法,请使用 .ToList() 在应用程序的分配中。

It looks like a bug in the Linq provider (you are using the old one, I tried the new one too and it still doesn't work).

You should open an issue in http://jira.nhforge.org/

As a workaround, use .ToList() in the assignment to apps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文