score:13

Accepted answer

skip and take are translated to the equivalents in sql which limit on rows and since you are eager fetching with joins there isn't much you can do about it.

to eager fetch the first 15 books you need to:

var all = session.query<book>()
    .skip(15)
    .take(15)                
    .tolist();

var ids = all.select(b => b.id).tolist();

// fetch all authors of the books, now the books in all have initialized authors
session.query<book>()
    .where(b => ids.contains(b.id))
    .fetchmany(books => books.authors)
    .list();

this has 2 roundtrips though

update: one roundtrip with queryover, maybe you can translate into linq

var subquery = queryover.of<book>()
    .skip(15)
    .take(15)
    .select(b => b.id);

var all = session.queryover<book>()
    .withsubquery.whereproperty(b => b.id).in(subquery)
    .fetch(books => books.authors).eager
    .tolist();

score:0

var data = session.queryover<employeedetails>()
                                  .where(x => x.salary > 2000)
                                  //.take(2)
                                  .skip(2)
                                  .take(2)
                                  .list();
                //if take is before skip then it will skip the last (mentioned digits) rows
                //if take is after skip then it will skip the first (mentioned digits) rows

Related Query

More Query from same tag