Paging in servicestack ormlite

后端 未结 2 439
野性不改
野性不改 2021-02-07 20:20

I am looking for a good way to implement paging in ormlite and I found another question, which has this snippet:

var data = db.Select

(predicate).Ski
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-07 20:48

    Found the answer in ormlite's tests. Essentially we could use SqlExpressionVisitor's Limit() like this:

    var result = db.Select( q => q.Where(predicate).Limit(skip:5, rows:10 ) );

提交回复
热议问题