gpt4 book ai didi

c# - 使用 SubSonic 寻呼

转载 作者:行者123 更新时间:2023-12-01 23:15:49 25 4
gpt4 key购买 nike

我正在使用 SubSonic 3 构建 MVC 2 应用程序 - 我尝试了许多不同的分页方法,但找不到任何合适的方法。

我有一个基本查询,该查询将传递到一个循环 View ,并且每次迭代都会调用强类型部分 View 。

        var SOQuestion= (
from q in repo.All<SOQuestion>()
orderby p.DateUpdated descending
select p
).Skip(5).Take(10);

我希望能够在适当的情况下添加过滤器,例如 tag = "mvc" 和/或 user = "me",同时合理地对结果进行分页.

什么解决方案既简单又整洁?

最佳答案

您可以使用 where 声明,正如 Lazarus 所描述的。

如果您需要动态执行此操作(即您不知道要提前过滤哪些字段),请查看 Dynamic Linq图书馆。

关于c# - 使用 SubSonic 寻呼,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3450715/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com