我想将以下查询从 nhibernate 标准查询 api 转换为 linq。
var userquery = session.CreateCriteria(typeof(User))
.SetFirstResult(pageIndex * pageSize)
.SetMaxResults(pageSize);
var totalcountQuery = CriteriaTransformer.Clone(userquery)
.SetProjection(Projections.RowCountInt64());
谢谢
更新
IEnumerable<User> dbUsers = userquery.Future<User>();
IFutureValue<long> count = totalcountQuery.FutureValue<long>();