Fetch vs FetchMany in NHibernate Linq provider

Fetch should be used for references and FetchMany for collections.

This is particularly important because only FetchMany can be combined with ThenFetchMany to fetch “grandchildren” collections.

Example:

session.Query<User>()
       .FetchMany(u => u.Orders)
       .ThenFetchMany(o => o.OrderItems)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)