Linq for NHibernate and fetch mode of eager loading

前端 未结 4 1135
广开言路
广开言路 2020-12-13 03:37

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. H

4条回答
  •  醉话见心
    2020-12-13 04:20

    just use it more then once.

    IList GetDataFromDatabase()
    {
        var query = session.Linq();
        query.Expand("Property1");
        query.Expand("Property2");
        return query.ToList();
    }
    

提交回复
热议问题