如何使用 Massive.cs 的 .Paged() 查询与表连接?
我使用 Massive,作者 Rob Conery 作为我的“DAL”。我已经使用它构建了一个存储库类。我遇到了一个小问题。我想使用 .Paged() 方法将分页构建到我的 ASP.NET MVC 视图之一中。
现在,没有分页,我正在使用 .Query()
return docTbl.Query("SELECT DISTINCT BaseDocs.* FROM BaseDocs
INNER JOIN DocCats ON BaseDocs.DocId = DocCats.DocId
WHERE DocCats.CatId IN (1,2,3,4) AND BaseDocs.BaseId = @0
ORDER BY BaseDocs.DateUpdated DESC", baseId);
我想使用 .Paged() 方法对此进行分页,这里我使用它(不在连接表上)
return docTbl.Paged(where: "BaseId = @0", orderby: "DateUpdated DESC",
currentPage: currentPage, pageSize: pageSize, args: baseId );
通过查看 .Paged() 来判断Massive.cs 中的代码,这可能是不可能的。我错过了什么吗?
提前致谢。
I'm using Massive, by Rob Conery, as my "DAL". I've built a repository class using it. I've run into a small problem. I'd like to use the .Paged() method to build paging into one of my ASP.NET MVC views.
Right now, without paging, I'm using .Query()
return docTbl.Query("SELECT DISTINCT BaseDocs.* FROM BaseDocs
INNER JOIN DocCats ON BaseDocs.DocId = DocCats.DocId
WHERE DocCats.CatId IN (1,2,3,4) AND BaseDocs.BaseId = @0
ORDER BY BaseDocs.DateUpdated DESC", baseId);
I'd like to have this paged, using the .Paged() method, here I use it (not on a joined table)
return docTbl.Paged(where: "BaseId = @0", orderby: "DateUpdated DESC",
currentPage: currentPage, pageSize: pageSize, args: baseId );
Judging by reviewing the .Paged() code in Massive.cs, this may not be possible. Am I missing something?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论