Search code examples
c#linqnhibernatenhibernate-criteria

Nhibernate criteria future translate to linq


I need to translate following queries into linq.

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

Thanks

Update: **

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**

**


Solution

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