Question

Linq for NHibernate and fetch mode of eager loading

Is there a way to set the fetchmode to eager for more than one object using linq for nhibernate. There seems to be an expand method which only allows me to set one object. However I need to set it for more than one object. Is this possible? Thanks

 45  21341  45
1 Jan 1970

Solution

 19

just use it more then once.

IList<Entity> GetDataFromDatabase()
{
    var query = session.Linq<Entity>();
    query.Expand("Property1");
    query.Expand("Property2");
    return query.ToList();
}
2009-05-06