nHibernate: limit the result set of a mapped collection
- by HeavyWave
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.