Nhibernate标准未来转化为linq

时间:2012-05-25 17:31:24

标签: c# linq nhibernate nhibernate-criteria

我需要将以下查询翻译成linq。

IEnumerable<User> data = myquery.Future<User>();
IFutureValue<long> count = totalcountQuery.FutureValue<long>();

由于

更新  **

myQuery = session.Query<User>()
               .Skip(pageIndex * pageSize)
               .Take(pageSize);

 totalCount = session.Query<User>().LongCount(); 
 dbUsers = myQuery.ToFuture();
 var count = myQuery.LongCount();
 totalRecords = (int)count.Value; **//Here is the error**

**

1 个答案:

答案 0 :(得分:1)

IEnumerable<User> data = myquery.ToFuture<User>();
IFutureValue<long> count = totalcountQuery.ToFutureValue<long>();