How do you limit the result set of a mapped collection in nHibernate? For instance:
Model.Items;
will always return all the Items for the given Model. Is there any way to force it to return only, say, 20 Items without creating a specific query ? Something like
Model.Items.SetMaxResults(20);
In other words, I would like nHibernate to return IQueryable instead of a simple IList, when I access a collection.
Update. Although I have accepted the answer, I would like to point out that this is not in line with nHibernate's intended way of usage, and a child collection should be loaded and limited within a separate query.