How to use Massive.cs's .Paged() query with table joins?
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 pagi开发者_StackOverflowng, 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.
精彩评论