Linq for NHibernate and fetch mode of eager loading

前端 未结 4 1132
广开言路
广开言路 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:29

    The new Linq provider does it a little differently:

    var customers = session.Query().Fetch(c => c.Orders).ToList();
    

    More here: http://mikehadlow.blogspot.com/2010/08/nhibernate-linq-eager-fetching.html

提交回复
热议问题